How to Enable Page Cache
Page caching is the main speed feature in xSpeed Cache. This guide shows you how to turn it on and explains what it does.
What this does
When page cache is on, xSpeed Cache saves a static HTML copy of each page the first time a visitor opens it. The next visitor who opens the same page gets that saved copy instead of making WordPress build the page again.
Building a page from scratch means running PHP and querying the database on every request. Serving a saved HTML file skips that work, so the page loads faster.
Page cache only applies to visitors who are not logged in. Logged-in users, admin screens, AJAX requests, cron, and REST requests are never served from the page cache.
Why use it
- Pages load faster because WordPress does less work per request.
- Your server can handle more visitors at the same time.
- Lower server load during traffic spikes.
How to enable it
- Go to the xSpeed Cache dashboard in your WordPress admin.
- Open the Cache page.
- Find the main cache toggle at the top of the page.
- Switch it on.
When you turn the toggle on, xSpeed Cache installs its advanced-cache.php drop-in and sets the WP_CACHE constant in wp-config.php. This lets cached pages be served before WordPress fully loads, which is the fastest path.
Note: If
wp-config.phpcannot be written automatically, xSpeed Cache shows you a small snippet to add yourself:define( 'WP_CACHE', true );. Add it near the top of the file, above the line that says “That’s all, stop editing.”
How serving works
xSpeed Cache can serve a cached page in a few ways, fastest first:
- Static file via the web server. On Apache or LiteSpeed, an
.htaccessrewrite serves a saved HTML file directly, skipping PHP entirely. On nginx, the dashboard shows a snippet you can paste into your server config to do the same. - Drop-in (PHP). The
advanced-cache.phpdrop-in serves the cached file early in the request, before most of WordPress loads. - Template redirect (PHP). A fallback path inside WordPress that serves the cached file when the drop-in is not active.
All paths send an X-XSpeed-Cache: HIT header on a cache hit, so you can confirm caching is working by checking the response headers.
Best practices
- Turn caching on and then load a few of your own pages while logged out to prime the cache.
- After major theme or content changes, purge the cache so visitors get the new version. xSpeed Cache also purges automatically when you publish posts, change settings, or switch themes.
- Review the exclusion settings if you run a store or membership site, so dynamic pages are never cached.
Troubleshooting
- My changes do not show up. The old page may still be cached. Purge the cache, then reload.
- The header shows MISS every time. The page may be excluded, carry an excluded cookie, or include a query parameter that is not on the ignored list. See the exclusion guide.
wp-config.phpnot writable warning. Add theWP_CACHEsnippet shown in the dashboard by hand.
FAQ
Does caching affect logged-in users? No. Logged-in users, admin pages, AJAX, cron, and REST requests are never served from the page cache.
Are only GET requests cached?
Yes. Only GET requests are eligible for the page cache.
Related
- Setting Cache Lifetime (TTL)
- Excluding Pages, URLs, and Cookies from Cache
- Separate Mobile Cache
- Bypassing Cache by User Agent