I have managed to load my web in less than 2 seconds using Swift Performance cache plugin. I have used many cache plugins for WordPress in the past, but with Swift Performance I’ve literally blown it.
In this article I explain how I got these results from GTmetrix and Google PageSpeed Insights.
Table of Contents
Initial setup of Swift Performance with Setup Wizard
Do you need help speeding up your site?
Get in touch with us and we will give you a customized solution
Both the installation and its setup is very simple. Once you activate it, a 4-step configuration process will be executed (setup wizard), during which you can change some parameters.
I recommend you to leave all the default options as will have a chance to change all the settings later. Here I share some screenshots of how I configured it:
In this step, you could link your Cloudflare account if you have it. I have done it but in a later step.
According to the tests I have done, if you do not activate Lazy Loading you will get better results with Google PageSpeed
IMPORTANT: When running your test, remember to select the nearest testing area.
Step by step Swift Performance setup
Here you have the video where I share all my Swift Performance cache settings.
General > Tweaks
‘Normalize Static Resources‘ is useless if you use “Merge Scripts” and “Merge Styles”. It improves higher page speed scores, but not actual speeds. I enable this but never for sites often updating their design. Many caching engines (also Cloudflare) already intelligently cache static assets with query strings.
‘Gravatar Cache‘ I usually disabled. Only useful if your site gets a constant amount of post comments.
General > Google Analytics
‘Bypass Google Analytics‘ is an awesome idea of locally-caching the Google Analytics JS script and merging it with site JS (theoretically removes one external call to google). In terms of speed, it didn’t help so much but does give you a higher page speed score (superficial benefit). The only problem is GA won’t work on uncached/excluded, for that reason I have decided to personally not use it.
Media > Images
‘Lazyload Images‘ and ‘Inline Lazy Load Images‘ is a counter-intuitive tactic of speeding up page load, by not loading everything. Some people hate it, I personally like using it as Google likes it too.
Optimization > General
‘Optimize Prebuild Only‘ Uncheck so your site is always optimizing. Enable to limit when cache is built (not needed for most sites).
‘Optimize in Background‘ I disable it, but can be useful for big sites and/or VPS servers.
‘Minify HTML‘ I disable because I use Cloudflare, and it already minifies HTML/CSS/JS.
‘Disable Emojis‘ I enabled it as I don’t use emojis in my content.
‘Limit Simultaneous Threads‘ Only enable it and set to 1, 2, or 3 if you’re on a shared server or want to prevent the site from hogging server resources. Ideally, you’d want to use all resources to prebuild cache quickly.
Optimization > Scripts
‘Merge Scripts‘ It’s safer to use when you have fewer scripts. The best use for it is to exclude main scripts.
Optimization > Styles
‘Merge Styles‘ It’s safer to use with fewer stylesheets.
‘Print full CSS inline‘ I don’t recommend it unless your page is super lightweight.
‘Minify CSS‘ I would stick to “basic” if I was going to use this at all. Choose “Don’t minify” if you prefer faster cache-building and/or already have it enabled from Cloudflare. Makes no impact on smaller sites.
‘Bypass CSS Import‘ Leave it enabled.
Caching > General
‘Enable Caching‘ You must enable this. If you don’t see this option or even the “Caching” tab, your host is probably disabling cache plugins.
‘Caching Mode‘ Disk cache with rewrites is fastest.
‘Early Loader‘ Should be checked.
‘Cache Path‘ Check this directory if caching or prebuild doesn’t work; might be the wrong path from an old server. (Go to cPanel “File Manager” for the right path.)
‘Cache Expiry Mode‘ – I use “Time based mode” as my site has not constant content updates (like new comments or changes in product status).
‘Enable Browser Cache‘ I enable it as it helps performance.
‘Enable Gzip‘ I leave it enabled.
‘AJAX Cache Expiry Time‘ I have set it to 1440 minutes as I want it to expire every 24 hours.
Caching > Exceptions
‘Exclude Post Types‘ You should exclude all post types EXCEPT posts, pages, products, and any post type that shows on the front-end with its own unique URL slug. (If don’t exclude any post types; the site will cache all items even if they don’t show on the front-end, further delaying cache prebuild for critical items. Big sites should definitely exclude unnecessary post types!)
‘Exclude Pages‘ You should exclude any pages with “live info”, “private data”, or don’t work properly when cached.
‘Exclude URLs‘ Exclude any URL’s that couldn’t be single out using post types or pages above.
‘Exclude Content Parts‘ Useful for excluding specific content or post types.
‘Exclude User Agents‘ Prevent certain devices from seeing cached pages.
‘Exclude Author Pages‘ I check this. Author pages aren’t visited often, so focus your caching mechanism on other pages.
‘Exclude Archive‘ I prefer it to be checked.
‘Exclude REST URLs‘ Checked. You don’t need these items pre-cached.
‘Exclude Feed‘ Checked. You don’t need these items pre-cached.
Caching > Warmup
‘Enable Remote Prebuild Cache‘ I disable it. Use only when your server can’t visit itself and can’t prebuild cache.
‘Prebuild Cache Automatically‘ I checked it. The only time you shouldn’t use prebuild is when you have so many pages, like over 1k.
‘Prebuild Speed‘ If you’re on shared hosting with resource limits, always try to use “Moderate”.
Caching > Varnish
‘Enable Auto Purge‘ Enable if you’re using Varnish. It clears Varnish cache automatically, so you don’t have to do it manually every time Swift clears cache.
‘Custom Host‘ Usually not necessary, unless you’re using Cloudflare or other DNS proxy. Enter the Varnish server IP and port here.
CDN > Cloudflare
‘Enable Auto Purge‘ Check it if you have Cloudflare. Otherwise, you’d have to manually purge Cloudflare cache every time you make changes on your site or Swift cache. (Make sure you enter your account email and API key.)
‘Cloudflare Account Email‘ Fill in your account email.
‘Cloudflare API Key‘ Put in your Cloudflare global API key.
‘Cloudflare Host‘ Put your domain name.
Swift Performance Plugin Organizer Setup
‘Plugin Organizer‘ It’s really easy to use. Simply enable where you want your plugins to load. A good example would be all form related plugins, which you want them to only be loaded where you have your forms included.
Remember, use a managed WordPress hosting service to suit all your websites needs. It’s also important to use a reliable web hosting service. For further reading, Techtage.com has a great review of SiteGround, one of our favourite web hosts at Awesome Web Designs.