Depending on the niche, the static content of your WordPress website may cause a lot of troubles and what is more important, it could drastically slow down your website. The best WordPress speed optimisation trends suggest that each site owner of developer needs to speed up the static content as it guarantees success in long run.
Before looking at the details of such optimisation, let’s answer some important questions:
What is WordPress static content ?
How static content appears on your website ?
Nowadays each theme and plugin comes with some kind of static content. As you can imagine, nobody would install theme without any colours or some at least basic style and functionality. These features are usually based on files, that generally speaking are falling into the category of static content.
Reduce or speed up the static content ?
Well, there is no definitive answer of this question. The practice shows that both of these approaches give positive result. Again, speaking generally, the best result is based on combination of these two.
How to reduce the static content ?
This could be tricky moment in WordPress speed optimisation. Unfortunately, there are no well known techniques that can be applied on every website over the Net. Still, there are a few good suggestions:
- You may review your articles and either reduce the number of images or at least compress them
- Remove any additional themes or plugins you do not need
- Check your theme’s main CSS file and try to identify the part you never used or will use. If you find large portions of extra elements, then perhaps you could remove them
- Take a look at your .htaccess file. Some security plugins add additional lines to that file making it quite large
- If you are familiar with JS files your theme uses, then perhaps you could remove or disable some of them. Majority of the themes out there come with 20,30 to 50 .js files that are being included in every single page, killing its speed this way.
Now after these more general suggestions, it is time to look at what is the remaining static content and how to optimise it of top performance. The first point here is to analyse the data flow and prepare a strategy. There are two options to achieve this: 1) Using browser console or 2) Using online tools such as gtmetrix or pingdom. Short explanations for each one of these approaches is as follows:
To analyse the speed using browser, just visit your page -> right click -> Inspect -> Network -> Refresh the page to see the results. Here is what is expected to be seen:
What we have here are one CSS, one JS and 2 image files. These are all static content and we have the following options to speed them up:
- Compress the existing images. This could easily be done using ewww plugin. This extension compresses the image while uploading, but also has bulk compress option which aims to optimise the existing files.
- The next step is compress CSS and JS files. Luckily we can apply similar tactics here. There is great plugin called Better WordPress Minify. It is focused on removing the unnecessary spaces from those files.
Now after these two simple steps, you can go back to perform the same test and analyse the data flow. The expected result is at at least 20% better stats and performance. If everything is fine, then we can look at the final touches. In order to achieve even better results, we need to use some caching mechanics. It could be Content Delivery Network, WordPress plugin installed on the application or caching feature installed on the server level. Depending on the situation each one of these solutions would give the desired result. If the hosting provider does not support caching on server level and using CDN is not an option, then W3 Total Cache seems to be logical approach. More information regarding the proper configuration can be found here in this post:
Another powerful and effecting caching mechanism is CloudFlare. This is content delivery network primarily focused on static cache optimisation. The setup is pretty easy and straight forward. It includes setting up account at the official website and DNS adjustments of your domain name. Here is how to setup your account:
- Create a new account at the official website
- Login and Click Add site. The button is on the top right corner of the screen
- The system will scan your domain name name and suggest updating name servers. That change can be done from the management area of your domain name registrar.
- After doing this, you will be able to proceed and activate the server
- Generating cache may take up to 24 hours
Even the free service offers a number of advantages. The main ones of them are :
- Detailed analysis of the traffic
- DNS management
- Secure connects also known as https
- Auto minify options
- Firewall and page rule settings
- Cache management utilities
- Additional network protocols such as RailGun, HTTP/2 + SPDY, WebSockets and True-Client-IP Header