Caching is the process of storing frequently visited web pages, locally. If a webpage is cached, your browser loads the files from your local storage instead of the server. It provides significant improvements to your website performance and saves your server resources.
Leverage browser caching is a high priority suggestion of GTmetrix report.
You can use WP Super cache plugin to cache your website.
WP Super Cache is most popular, yet has a major drawback. Setting up WP Super Cache is hard (even harder for Nginx users).
This guide shows the best WP super cache settings. It illustrates two methods,
- Using WP Super cache
- Using WP Super Cache with Cloudflare
If you are using an Nginx server, you need to edit the configuration file to make full use of WP Super Cache. A simple error in the configuration file may break your site. If you do not have experience editing the configuration files, I recommend to use WP Fastest cache plugin. In WP Fastest cache you need not configure Nginx files, and the setup process is much simpler.
- Backup your site – Incorrect configuration of Super Cache may break your site. So it is always better to have a backup. I recommend you to use UpdraftPlus.
- Disable other caching plugins – Enabling two caching plugins simultaneously hurts your website performance. I recommend you turn them off.
- Cloudflare account(Optional) – If you are going to use a Cloudflare in this guide, sign up for an account (Explained in step 7) Else skip this.
Step 1 – Installing WP Super Cache
Install and activate WP Super Cache from your Plugin Dashboard
WordPress takes you to the installed plugins dashboard, on WP Super Cache activation. Scroll down to the bottom where you can find WP Super Cache. Now click Settings
Step 2 – Configuring WP Super Cache – Easy Settings
Caching – The easiest way to boost the performance of a website. Enable this.
Once enabled, click on Update Status to save this configuration.
Besides turning on caching, WP Super cache provides you with few tools to manage it. You’ll set them in next steps.
Test cache (Does not work if you use Cloudflare)- You can test if WP Super Cache works by clicking this.
Delete cache – If you see an older version of your page, click this to delete your website cache. It helps you view the latest content of your site.
Step 3 – Configuring WP Super Cache – Advanced Settings
Click on the advanced tab.
1. Enable caching – If it is not already on, Enable this.
2.Cache delivery method – WP super cache uses two ways to serve cache files.
Simple caching – Simple method uses PHP to serve cached static files. It is enough for most websites. Enable this.
Expert caching – Expert method provides better performance than simple caching. It uses an Apache module for serving files.
To use this method, you need to tweak your .htaccess file and set up mod_rewrite module.
In addition to this, you need to set custom rules if you host your site on an Nginx server.
If you are not confident about what you are doing, do not make any changes to the .htaccess or Nginx Configuration file. A small error could break your site.
1.Enable caching for all visitors – Displays cached pages for all visitors, including yourself. This prevents you from viewing live pages of your site.
2.Disable caching for visitors who have a cookie set in their browser – If the visitor sets cookies, live content is served. This takes a toll on site performance.
3.Disable caching for logged-in visitors – Enables caching for all visitors except admin. This helps you view live pages without consuming a ton of server resources. Enable this.
4.Do not cache pages with GET parameters – It caches the same page that is unique for different users. Ex: The same google ads will be displayed to two unique visitors. No personalized ads = reduced probability of a user clicking an ad. Leave this off.
5.Compress pages so they’re served more quickly to visitors (Turn off if you use Cloudflare) – a.k.a Gzip Compression. It helps you compress the elements of the site before transfer. Reduces transfer time and improves performance by 85%. Enable this.
Gzip compression is a high priority item in GTmetrix report. Cloudflare users will use a similar compression method called Brotli.
6.Cache rebuild. Serve a supercache file to anonymous users while a new file is being generated – Shows an older cached version of the site when a new cache file is generated. Enable this.
7.Cache HTTP headers with page content – Makes PHP file delivery slower in exchange for increased speed in static file delivery. Simple caching uses PHP file delivery to serve static files and enabling this slows the process. Leave this off.
8.304 Browser caching. Improves site performance by checking if the page has changed since the browser last requested it. – Tells the browser if a page is updated since the browser last requested it.
If the page is updated – Browser re-caches the new files from the site.
If the page is not updated – Browser loads files from visitor’s local storage.
Provides a significant performance boost. Enable this.
9.Make known users anonymous so they’re served supercached static files – This setting overrides the earlier setting, Do not cache pages for known users (Option 3) and serves static files for everyone. Leave this off.
Non-Cloudflare users will have the following configuration.
Cloudflare users will have the following configuration.
10.Enable dynamic caching – Enables caching of dynamic modules such as Google ads and share count. Leave this off.
11.Mobile device support – (Requires extra plugins to work) – Responsive website themes adapt to the device it is displayed on. Non-responsive themes don’t. To make your non-responsive themes responsive, enable this.
Install any one of the following plugins and configure them to complete the process.
- Wp Touch
- WordPress Mobile Pack – (Untested with 3 major releases of WordPress, may have compatibility issues)
Leave this off if you use a responsive theme.
I recommend you to switch to a lightweight and responsive theme if you have not changed yet. OceanWP, Astra and Generate Press are great options. This is because non-responsive themes are not mobile-friendly and mobile-friendly pages are a crucial part of Onpage SEO.
12.Remove UTF8/blog charset support from .htaccess file – If your site displays incorrect punctuation marks or odd characters enable this. Else leave this off.
13.Clear all cache files when a post or page is published or updated – Clears cache files when a post/ page is updated. This allows visitors to view fresh content. Enable this.
14.Extra home page checks – Makes sure that your latest posts are visible on your homepage. Enable this.
15.Only refresh current page when comments are made – Useful if your site receives a ton of comments. Helps you re-cache those pages with new comments instead of re-caching the entire site. This allows visitors to view the latest comments, with little expense in server resources. Enable this.
16.List the newest cached pages on this page – Shows a list of cached pages for the visitor. Leave this off.
17.Coarse file locking. You do not need this as it will slow down your website – Leave this off.
18.Late init. Display cached files after WordPress has loaded – Fixes the error, super cache dynamic page detected but late init not set. Enable this.
19.Cache location – The default cache location works well. Leave this unchanged.
The following would be the resulting configuration for both Cloudflare and non-Cloudflare users.
Click Update Status to save your changes.
Step 4 – Configuring Cache Settings of WP Super Cache.
1.Cache timeout – Determines the time interval at which pages are re-cached and served.
Set cache timeout to 3600 seconds, unless you have high traffic site. If you do, set it 1800. This determines life of a cached page. The lower the cache timeout, the faster your server resources get consumed. If the timeout is very high, cached pages may not be visible to your users.
Now click Change Expiration.
2.Accepted file names and rejected URIs (Optional)- Specify page types, which you do not wish cache. Ex: e-commerce pages. Once you have chosen page types, click Save settings.
3. Strings (Optional) – Detects similar strings from URLs and forces a page not to be cached. For example, if you specify the string as ‘/2019/’, URLs containing the string 2019 will not be cached. Click Save Strings once you have added required strings.
4.Filenames (Optional) – Using the strings feature, you have disabled caching for URLs with the string 2019. Posts published in 2019 are not cached. Now, what if you wish to cache a specific post from 2019? This is where filenames feature helps.
Add filenames of pages which you do not wish to cache in the filename box. In this case it’s cache-page.php.
Using this method, you can cache specific files even if you have excluded them in Strings.
Once you’ve added them, click Save Files.
5.Rejected User Agents(Optional) – Prevents user agents search engines from viewing cached pages. Leave this untouched. Because accidental deletion of Google’s crawler bot causes google to view cached pages. This may lead to poor rankings.
Leave this box untouched
6.Lock Down(Optional) – Enable only if there is a significant increase in site traffic within a short period. This prevents websites from crashing.
Turning this on overrides our earlier setting, doesn’t cache separate pages when a new comment is posted(Advanced settings option 15). A new cache is not generated even when a new comment is posted. It preserves server resources and prevents your site from crashing.
Step 5 – (Optional)Understanding Contents Settings of WP Super Cache
Your site’s cached pages expire automatically. This prevents visitors from viewing stale content.
But if your cached pages don’t expire due to errors, you can clear them off using the delete cache button. This clears your entire cache database.
If you want to clear cache files of a specific page, you can click list all cached files, find pages you wish to refresh and delete their cache.
Step 6 – Configuring Preload Settings of WP Super Cache
Navigate to the Preload tab.
Preload caches all your website’s posts and pages periodically. Here, the time interval is a critical setting.
If you don’t update your site twice a day/ use shared hosting, I recommend you set it to 1440 minutes. (1 day). It’s not recommended to set the time interval to lower values. This is because recaching consumes a ton of server resources and may exhaust your monthly bandwidth (especially in shared hosting environments) and overloads your server.
If you update your website twice a day, set it to 720 minutes. You can also set this value to 0 if you don’t want static files to expire until you manually refresh the cache.
Enable this to improve indexing and website speed. Select preload mode(garbage collection disabled. Recommended).
Step 6 – (Optional)Configuring Plugin Settings of WP Super Cache
Leave this tab unchanged, unless you use any of the following plugins,
If you do use any one of the above plugins, Click Enable and Update.
Leave the debug settings and CDN settings undisturbed.
You’ve successfully configured WP super cache settings and made your site faster.
If you’re a Cloudflare user, continue to the settings below.
Step 7(Cloudflare Users Only) – Configuring CDN Settings of WP Super Cache
CDN(Content Delivery Networks) refers to geographically distributed servers around the globe. It uses intermediary servers to reduce the physical distance between the User and the Origin Server.
Using a CDN is a crucial recommendation in GTmetrix report.
1.Login to your cloudflare account.
2.Once you’ve signed up, enter your website name and choose the free plan. Finally, click Confirm plan.
3.Cloudflare gives you two nameservers. Replace your existing nameservers with the ones provided by Cloudflare in your CPanel. Most hosting providers provide an option to activate Cloudflare in your CPanel.
Here’s a list of instructions for changing your nameservers on popular hosting providers. If you cannot find your hosting provider, perform a google search or contact them for support.
4.Navigate to speed settings of Cloudflare once you have changed the name servers. Click Optimization.
5.Scroll down to find Brotli. It’s a similar compression technique like Gzip. Turn this on.
But, if you wish to use GZip, turn this off before turning on Gzip from the basic settings panel of WP Super Cache. Here’s a post comparing both compression methodologies – GZip vs Brotli.
6.Enable Railgun. It aids in speed improvement by leveraging compression techniques, mainly dynamic content.
You shouldn’t turn on minification in Cloudflare because WP Super cache does that for you. Feel free to set page rules and configure other settings of Cloudflare ONLY IF you know what you’re doing.
You have successfully configured WP super cache along with Cloudflare to create a performant site.
To summarize, you’ve configured WP Super cache settings. You have also used Cloudflare to improve website performance.
Caching is not the only way to make your site faster. As a WordPress user, you can also do a few other things to make your website faster
- Update to PHP to latest Version
- Remove the bloating plugins
- Use lightweight themes such as GeneratePress and Astra
- Use Fast hosting such as CloudWays.
1. What other performance plugins do I need besides WP Super Cache?
2. Which are the best cache plugins for WordPress?
WP Super Cache, WP Fastest Cache are some of the best free caching plugins. If you’re ready to invest in a premium plugin, I recommend WP Rocket.
3. How do I clear WP Super Cache’s Cache files?
Navigate to WP Super Cache Settings, click on the Contents tab and click Delete cache.
4. How do I uninstall Wp super cache?
Before deleting WP Super Cache, go to WP Super Cache settings page and turn off all caching. Delete Cache using the button available at the bottom of the same page. Now deactivate and delete the plugin via the plugin dashboard.
5. Is WP Super Cache free?
WP Super Cache is a free plugin packed with a ton of features from caching to Gzip compression.