PageSpeed Part III – Optimize the Mobile Experience, Browser Caching, & Redirects
For the last post in this series we will be going over the remaining suggestions from Googles’ PageSpeed insights.
Avoid landing page redirects
When someone goes to your site they, should be redirected once at the most before loading the page. For example, a good redirect chain would be: example.com -> https://www.example.com, a bad redirect chain would be: example.com->www.example.com -> https://www.example.com. You can use this website to test your site for redirects: http://redirectcheck.com/. On a related note, you will want these redirects to be “301” or “Permanent” redirects as opposed to “302” or “Temporary” redirects.
There are 3 primary ways that your site may be cached (Stored so that it can be accessed faster in the future). Browser caching, WordPress caching, and using a CDN.
• Browser Caching: Files that have been previously requested are stored on a user’s computer. That way, instead of downloading an identical file every time, the user can instead use the previously downloaded file. When requesting a file, the server response will tell the browser if a browsers cached file can be used or if the user should download a fresh one from the server. If you receive the suggestion to “Leverage Browser Caching” for files on your url you may want to contact us to make sure that the server configuration is optimized for browser caching on your site.
• WordPress Caching: A caching plugin is used to achieve WordPress caching. There are many caching plugins and most of them are equally good and only have minor differences from one to the next. We most commonly install and use WP SuperCache, WP Rocket, or Comet Cache, on sites that are hosted with us. WordPress pages use dynamically generated content. This means that whenever you write a post, you don’t have to write the html for the page or create a new homepage with a snippet of the post you just wrote. WordPress automatically generates those pages for your users using your theme. This saves you a lot of editing but page generation takes more time than it takes to serve static (non-changing) content. This is where WordPress Caching comes into play. A caching plugin will save the generated page, that way it doesn’t have to be regenerated every time for every visitor. When the plugins’ cache is cleared (Which happens automatically when any settings are changed or a new post is made) then it requires all pages to be generated and cached again. If you see the “Improve Server Response Time” suggestion, your WordPress cache may not be working optimally.
• CDN: A content delivery network, or CDN, is a geographically distributed network of servers. A CDN will cache data from your website at multiple locations all around the world. This makes it so that no matter where your visitor lives, the data they are downloading is travelling a shorter distance and they are using less of your servers bandwidth. Popular CDN’s include Cloudflare and Sucuri CDN.
Improve Server Response Time
This is also known as time to first byte (TTFB). This is the time between making a request and receiving the beginning of the response. It is measured by adding together all the time it takes to perform the following: DNS Lookup, redirection, connection, response generation. There are many tools that you can use to test your TTFB such as gtmetrix.com and bytecheck.com. A recommended TTFB is anything less then 200ms. Results between 200-500ms is acceptable. A consistent TTFB that is more then 500ms usually means there is a problem with your websites WordPress cache or server configuration. If you are a current customer and you find your website is consistently over 500ms, contact us so we can troubleshoot it with you. Using a CDN may also help lower your TTFB.
Configure the viewport
This usually means your theme has not been configured to properly display content on mobile devices. Most new themes should follow basic guidelines for optimizing mobile responsiveness and experience. Ideally you will want to consider changing themes if you see this suggestion.
Thanks for joining us for the conclusion of this series! We hope you’ve found the information useful for improving your sites performance. Look out for future articles on improving your sites performance as well as various other hosting related tips.
The Orange Geek Team
Read the rest of the posts in this series: