CDN – Performance Questions
Why is my Google PageSpeed score lower on mobile?
The main difference in the Google PageSpeed results between desktop and mobile is due to the way they're tested.
How is the mobile PageSpeed score tested by Google?
The mobile test is run with internet connection limits and a relatively-slow CPU. Currently, Google PageSpeed loads the web page as if it's on a mid-tier device (Moto G4) on a mobile network. The mobile network has these limits:
Latency: 150ms
Throughput: 1.6Mbps down / 750 Kbps up
Packet loss: none
More information about the network throttling can be found here.
Why is the mobile PageSpeed score low?
With this being the case, if your website is JavaScript-heavy, then you'll find that the less powerful mobile device - when compared to a desktop - will parse and process JavaScript much slower. This will lead to a longer load time. So it's important when optimising your site for mobile that you make sure that there is no unused JavaScript, and that any being used is well optimised.
How to improve a low PageSpeed score?
You can optimise the site with our Website Acceleration Suite, part of the free 20iCDN. You can use the JavaScript section to minifiy and optimised the JavaScript for the site and the image optimisation section to automatically create appropriately sized images for the mobile devices loading the site. More details on that here.
Unfortunately, this won't always get you a perfect score on mobile. This is because our tools won't ever remove Javascript from your site and Google PageSpeed Insights will still give a lower score for any unused Javascript on the page.
In most cases, to get a better score you'll need to make changes to the website's code, making sure that all JavaScript being loaded on any page is being used by that page.
Why am I getting a cache status 'MISS'?
Headers returning x-cdn-cache-status MISS indicate the request was served by the origin 20i server. This means that the response was not found in the cache and so was fetched from the origin server. This could result in a longer time-to-first byte (TTFB) and a longer total load time. On pages you want to be cached you'd expect to see x-cdn-cache-status HIT.
A cache 'MISS', or 'BYPASS' status is usually caused under three main conditions:
- Browser cookies being set
- Conflicting caching plugins
- Cache-control headers set in a .htaccess file
- Being logged into /wp-admin
Browser cookies
When a cookie is in use on a webpage the CDN edge cache will automatically avoid caching the content. When present, cookies work with the PHP as the page is loaded in order to perform a unique action. When a page is served from cache, it’s already been generated previously by the server. If the page is cached, the cookie cannot be generated and perform its action with the page load as expected.
Some applications also use a PHPSESSID cookie which prevents pages from being cached, for example, WooCommerce sets a PHPSESSID. In many cases this cookie doesn't alter behaviour, so disabling the cookie is one way to optimise and configure your site to work best with cache.
We have an option you can use within StackCache to help with this.
- Log in to /wp-admin and head to StackCache which you'll find down the left-hand side.
- By default, Remove PHP Session Cookies Matching Empty PHP Sessions will already be set, but you may wish to try selecting Remove PHP Session Cookies From All Pages.
- Select Save Changes.
Once saved, log out of /wp-admin and try refreshing your site or page you're trying to ensure is cached.
Conflicting Caching Plugins
Our platform comes with various layers of caching built-in. One of the most effective of these caching layers, especially at scale, is our edge cache system.
Unfortunately, most cache plugins will interfere with this and as a result, we don't recommend running any caching plugins on your WordPress site.
This includes, but is not limited-to: W3TC, Super Cache, WP Rocket and Hummingbird.
Don't panic! You won't need them - all caching plugins are built for speed, and you can rest assured our StackCache plugin will do that hard work for you.
Cache-control headers set in a .htaccess file
Cache-Control and Expires headers can be set in the .htaccess file within the root directory for the site. These let you control various elements of how your site is cached, including preventing caching altogether.
If you were to add Cache-Control: no-store into a .htaccess file then the HTTP headers would serve a directive to prevent the site from caching and a cache MISS would be received via the HTTP headers.
If you receive a cache MISS then you should review your .htaccess file for any conflicting directives.
Being logged into /wp-admin
When you're logged into /wp-admin we'll always force a cache bypass in the HTTP headers to ensure WordPress admin is never cached. If you're trying to ensure your site is being cached you'll need to logout of /wp-admin first, and then test your site, otherwise, the site will never be cached.
How do I create a Website Acceleration Suite template?
There are over 40 settings in the Website Acceleration Suite that can make your site load faster. You can save a template of your ideal settings so you can apply this to any other sites you host with us.
Making a template of your Acceleration Suite settings is quick and easy.
- Head to Manage Hosting > Options > Manage for the package from which you want to create a template.
- Select the Web Optimisation icon.
- If you haven't already done so, configure the options that best suit the site(s) that you build. The options you may select may depend on a number of factors; most of the time you'll want to select the most options whilst ensuring they don't interfere with website functionality.
- Once you've configured your template, select Save Profile from the right-hand side. Enter a name for this profile and select Save.
Restoring a template of your settings.
- Head to Manage Hosting > Options > Manage for the package from which you want to restore a template.
- Select the Web Optimisation icon.
- Select Load Profile from the right-hand side.
- Select the name of the profile you wish to restore and select Load Profile to restore the settings.
You can also update a current template after making changes - and delete saved ones you no longer need - in the same place.
You can get access to 20i's Website Acceleration Suite if you have 20i web hosting, Managed Hosting or WordPress hosting.