Cleast Intwood
Power Member
- Jul 2, 2016
- 689
- 421
I've been spending a lot of time to optimize my sites. Many hours here and there, so I thought id write a guide on the best setup I've found so far.
There are many good plugins, but no one of them covers all that I need so I use a set of plugins for this. There are surely easier ways to add caching and CDN, but I think this is one of the most effective methods.
The plugins I use:
REMEMBER TO BACKUP YOUR SITE BEFORE U MAKE THESE CHANGES
Many of you will want to run the same or very similar settings like me, but of course, all sites are different so pay attention when u do this and check what ur actually enabling. There are more options that might be more suitable for you, or even better for me as well as this guide won't be perfect, but good.
Make sure u don’t enable the same feature on two different plugins, or contradictory features like disable google fonts on one and compress google fonts on the other. It will probably still work but might break the site, and put extra load on your server for sure.
Before we begin, test your site with these two tools:
https://tools.pingdom.com/
https://gtmetrix.com/
Ok so let's dive into it, these are the settings I set for each plugin
WP Rocket:
(If you use another cache plugin, set similar settings)
//www.facebook.com
//connect.facebook.net
//otherdomain.com
Etc
Clearfy
To expand a bit on why i use this setup with the velocity plugin etc, its because if you use caching with WP rocket or similar plugin it will have a pretty short expiry of minified files, so the CDN will reload your files which results in volatile load times for your site.
Most loads will be fast, but once in a while there will be a much longer load time because of the CDN reloading the CSS/JS(every minute or so, not sure how long the caching setting is but its not long)
Did it help? Got feedback? Know better settings? Would love to hear ur results or feedback in the comments!
There are many good plugins, but no one of them covers all that I need so I use a set of plugins for this. There are surely easier ways to add caching and CDN, but I think this is one of the most effective methods.
The plugins I use:
- WP Rocket(I think WP fastest cache should work almost just as well, but then use WP optimize to optimize database)
- Fast Velocity Minify ( For minified CSS/Javascript that stays cached and not rebuilt every X seconds)
- Clearfy(For disabling unnecessary settings in WP, might be better/slimmer plugins available for this)
REMEMBER TO BACKUP YOUR SITE BEFORE U MAKE THESE CHANGES
Many of you will want to run the same or very similar settings like me, but of course, all sites are different so pay attention when u do this and check what ur actually enabling. There are more options that might be more suitable for you, or even better for me as well as this guide won't be perfect, but good.
Make sure u don’t enable the same feature on two different plugins, or contradictory features like disable google fonts on one and compress google fonts on the other. It will probably still work but might break the site, and put extra load on your server for sure.
Before we begin, test your site with these two tools:
https://tools.pingdom.com/
https://gtmetrix.com/
Ok so let's dive into it, these are the settings I set for each plugin
WP Rocket:
(If you use another cache plugin, set similar settings)
- Enable cache for desktop and phone.
- Enable Lazy load for images and videos, replace youtube iframe with preview image.
- Disabled WordPress embeds
- Add automatic preload from Yoast(Might not be a good idea if ur on weak shared hosting, I use digitalocean)
- Optimize database(can be done with WP optimize instead if u don’t have rocket)
- Add CDN URL
- Force HTTPS urls(if u run HTTPS that is)
- Strip HTML comments
- Inline Google Fonts CSS
- Add CDN URL
- Under Preconnect Headers, I added all the external domains that im loading scripts from(u can easily see these if u run a pingdom speedtest and scroll down to the request list)
//www.facebook.com
//connect.facebook.net
//otherdomain.com
Etc
Clearfy
- Run one-click code clearing
- Then goto performance tab, enable the following(unless u actually need one of these, read at the question mark if)
- Remove RSD link
- Remove wlmanifest link
- Remove shortlink
- Remove links to previous next post
- Remove .recentcomments styles
- Disable google maps(unless u use it obv)
- Dont enable Gzip on ur cdn, as we already have css/js minify(thinking of it, gzip with LOW compression MIGHT improve it further but im not sure, have to test this)
To expand a bit on why i use this setup with the velocity plugin etc, its because if you use caching with WP rocket or similar plugin it will have a pretty short expiry of minified files, so the CDN will reload your files which results in volatile load times for your site.
Most loads will be fast, but once in a while there will be a much longer load time because of the CDN reloading the CSS/JS(every minute or so, not sure how long the caching setting is but its not long)
Did it help? Got feedback? Know better settings? Would love to hear ur results or feedback in the comments!
Last edited: