Fix Guide

How to Set Up a WordPress Caching Plugin

February 8, 2026

Every time a visitor loads a WordPress page, the server has to run PHP, query the database, assemble the HTML, and send it back. That process takes time, especially on shared hosting. A caching plugin short-circuits most of that work by storing a ready-made HTML copy of each page. The next visitor gets the pre-built file instead of waiting for WordPress to generate everything from scratch. The result is often a 50 to 90 percent improvement in page load time, and your server can handle significantly more traffic before slowing down.

Why Caching Matters for WordPress Performance

WordPress is a dynamic CMS. Without caching, even a simple blog post triggers dozens of database queries and multiple PHP file includes. On a page with several plugins active, that number can climb into the hundreds. Caching eliminates this overhead for the vast majority of visitors who see the same content. It also reduces your Time to First Byte (TTFB), which directly influences Core Web Vitals and search rankings. If you only do one thing to speed up your WordPress site, install a caching plugin.

Setting Up WP Rocket (Premium, Recommended)

WP Rocket is a premium plugin, but it delivers the best out-of-the-box experience. Here is how to get it running:

  1. Purchase WP Rocket from wp-rocket.me and download the zip file.
  2. In your WordPress admin, go to Plugins > Add New > Upload Plugin and install the zip.
  3. Activate the plugin. Page caching and browser caching are enabled automatically, no configuration needed.
  4. Navigate to Settings > WP Rocket > Cache. Enable "Mobile Caching" if your theme uses responsive design (most modern themes do). Leave "Separate cache files for mobile devices" disabled unless your theme serves completely different HTML to mobile users.
  5. Under the File Optimization tab, enable "Minify CSS files" and "Minify JavaScript files" to reduce file sizes.
  6. Enable "Optimize CSS Delivery" to remove render-blocking CSS. WP Rocket will generate the critical CSS for each page automatically.
  7. Enable "Delay JavaScript Execution" to prevent third-party scripts (analytics, ads, chat widgets) from blocking the initial page render.
  8. If you use a CDN like Cloudflare or BunnyCDN, go to the CDN tab and enter your CDN URL so that static assets are served from the CDN domain.

Setting Up W3 Total Cache (Free, Feature-Rich)

W3 Total Cache is one of the oldest and most configurable caching plugins. It can be overwhelming at first, so focus on these core settings:

  1. Install W3 Total Cache from the WordPress plugin directory and activate it.
  2. Go to Performance > General Settings. Under "Page Cache," enable it and select "Disk: Enhanced" as the method. This option offers the best balance between performance and compatibility.
  3. Under "Minify," enable it and set the mode to "Auto." Choose "Disk" as the minify cache method.
  4. Under "Browser Cache," enable it. This tells browsers to store static files locally so they do not need to be re-downloaded on subsequent visits.
  5. Save all settings and go to Performance > Page Cache. Under "Cache Preload," enable automatic priming so the cache is built before visitors arrive.
  6. If your hosting supports Memcached or Redis, you can switch the object cache and database cache to those backends for additional speed. If you are on shared hosting, stick with "Disk" to avoid compatibility issues.

Setting Up WP Super Cache (Free, Simple)

WP Super Cache is maintained by Automattic and focuses on simplicity. It is a solid choice if you want caching without the complexity:

  1. Install WP Super Cache from the plugin directory.
  2. Go to Settings > WP Super Cache.
  3. On the Easy tab, select "Caching On" and click "Update Status."
  4. Switch to the Advanced tab. Select "Use mod_rewrite to serve cache files" for best performance on Apache servers. This method serves cached pages without even loading PHP.
  5. Check "Compress pages so they are served more quickly to visitors" to enable GZIP compression.
  6. Under "Expiry Time & Garbage Collection," set the cache timeout. A value of 3600 seconds (1 hour) works well for most sites. Sites that rarely update content can use longer intervals.

Setting Up LiteSpeed Cache (Free, Best for LiteSpeed Servers)

If your hosting provider runs LiteSpeed or OpenLiteSpeed web server, this plugin delivers server-level caching that is faster than any PHP-based solution:

  1. Install LiteSpeed Cache from the plugin directory.
  2. Go to LiteSpeed Cache > Cache and make sure the main cache toggle is enabled.
  3. Leave "Cache Logged-in Users" disabled unless you have a membership site where logged-in users see the same content.
  4. Under "Cache > TTL," keep the default values. The public cache TTL of 604800 seconds (7 days) is appropriate for most sites.
  5. Go to Page Optimization. Enable CSS Minify, JS Minify, and CSS/JS Combine. LiteSpeed Cache handles these operations at the server level, so they are faster and more reliable than plugin-based alternatives.
  6. Enable "QUIC.cloud CDN" for a free CDN option if your site has moderate traffic.

Note: LiteSpeed Cache also works on Apache and Nginx servers, but only the page optimization features are available. The server-level caching requires a LiteSpeed web server.

What to Exclude from Cache

Not every page should be cached. Dynamic pages that show different content per user or per session will break if served from cache. Here are the most important exclusions:

  • WooCommerce pages: Cart, checkout, and my-account pages must be excluded. Most caching plugins detect WooCommerce and add these exclusions automatically, but double-check under the exclusion settings.
  • Logged-in user pages: Disable caching for logged-in users unless your membership content is identical for all members. Caching personalized dashboards will show one user's data to another.
  • REST API endpoints: API responses should not be served from page cache since they are typically dynamic. Most plugins already exclude the /wp-json/ path by default.
  • Form confirmation pages: If your forms redirect to a "thank you" page with dynamic content, exclude that URL.
  • Pages with real-time data: Stock tickers, live scores, or other frequently changing content should bypass the cache.

Cache Preloading and Warming

A cold cache means the first visitor after a cache clear or expiration has to wait for a fresh page to be generated. Cache preloading solves this by automatically visiting your pages in the background to build the cache before real visitors arrive. WP Rocket calls this feature "Preload Cache," W3 Total Cache calls it "Cache Preload," and LiteSpeed Cache includes a built-in crawler. Enable preloading so your sitemap-based URLs are always warm and ready to serve.

How to Test Cache Effectiveness

After setting up your caching plugin, verify it is working correctly:

  1. Open an incognito/private browser window (to avoid logged-in cookies bypassing cache).
  2. Load your site and check the page source. Most caching plugins add an HTML comment at the bottom, something like <!-- This page is cached by WP Rocket --> or <!-- Page generated by LiteSpeed Cache -->.
  3. Measure your TTFB before and after caching. Use your browser's developer tools (Network tab) or a service like webpagetest.org. A cached page should have a TTFB under 200ms on decent hosting. Without caching, TTFB on shared hosting often exceeds 800ms or more.
  4. Run a load test with a tool like Loader.io or k6 to confirm your server handles more concurrent visitors with caching enabled.

Clearing Cache After Updates

Remember to clear your cache after making changes to your site. This includes publishing new posts, updating plugins or themes, changing menus or widgets, and modifying theme settings. Most caching plugins clear the cache automatically when you publish or update content, but changes to theme files, plugin settings, or custom CSS may require a manual cache purge. You will find a "Clear Cache" or "Purge All" button in the admin toolbar or in the plugin settings.

Verify Caching with InspectWP

After setting up your caching plugin, run a new InspectWP scan. The WordPress section will detect your active cache plugin. Check the performance section for improvements in TTFB and content encoding (GZIP or Brotli). If the cache plugin is not detected, make sure it is activated and that the page you are scanning is not excluded from caching.

Check your WordPress site now

InspectWP analyzes your WordPress site for security issues, SEO problems, GDPR compliance, and performance — for free.

Analyze your site free