2026年11月12日
2026年11月12日
W3 Total Cache Setup: Page Cache, Browser Cache, and Minify Steps
This article is a localized edition of the Japanese original. Read the Japanese original
W3 Total Cache is a caching plugin that lets you configure page cache, browser cache, file minification (Minify), database cache, object cache, CDN integration and more in one place. Because it has so many settings, this article walks through them in order, starting with page cache, which has the biggest effect and is the least likely to break anything.
The details were checked against the WordPress.org plugin page (version 2.11.0) and the distributed source code as of November 2026. Screen labels are given as they appear in the plugin's English interface.
1. Install and activate
In the admin, go to "Plugins" → "Add New", search for "W3 Total Cache", install it and activate it. With WP-CLI, the command is:
wp plugin install w3-total-cache --activate
After activation, a "Performance" menu is added to the admin. If you use another caching plugin, deactivate it first. Running the same kind of cache in two plugins at once can cause display problems.
"Performance" → "Setup Guide" measures page load times for each page cache, database cache and object cache method and lets you choose while looking at the results. The steps below make the same settings in "General Settings".
2. Check the initial state
These are the main settings right after activation (the defaults in the source code).
| Feature | Initial state |
|---|---|
| Page Cache | Off. The default method is "Disk: Enhanced" |
| Browser Cache | On |
| Minify | Off. The default mode is "Auto" |
| Database Cache | Off |
| Object Cache | Off |
3. Turn on page cache
Page cache saves the finished HTML of a page and returns that HTML on the next request. It is the setting with the biggest effect on page speed.
- Open "Performance" → "General Settings"
- Under "Page Cache", check "Enable"
- Choose the "Page Cache Method". For shared servers such as typical rental hosting, the screen marks "Disk: Enhanced" as the best choice
- Click "Save all settings"
"Disk: Enhanced" serves the saved HTML straight from the server without going through PHP, so it adds rewrite rules to .htaccess. On Apache, W3 Total Cache writes these rules automatically. On Nginx, you need to include the nginx.conf file that W3 Total Cache writes to your site folder from your server configuration.
By default, logged-in users are not served cached pages ("Don't cache pages for logged in users" is on). That means you cannot see the effect in a browser where you are logged in. Section 7 explains how to check.
4. Check browser cache
Browser cache adds expiration headers to images, CSS, JavaScript and other files so visitors' browsers keep them. It is on by default, so just confirm that "Browser Cache" is checked in "General Settings". You can change the detailed expiration times in "Performance" → "Browser Cache".
5. Turn on Minify while checking the display
Minify strips whitespace and comments from HTML, CSS and JavaScript and combines files. With some themes and plugins it breaks the layout or stops JavaScript from working. Make a backup before turning it on, and afterward check the display of your main pages and that things like forms still work.
- In "General Settings", check "Enable" under "Minify"
- Leave "Minify mode" at "Auto" (if you choose "Manual", you have to register the files to minify yourself)
- Save, then check how the site looks
If the layout breaks, narrow down the cause in this order.
- In "Performance" → "Minify", turn off only JS (or CSS) minification to see which one causes the problem
- Once you find the file responsible, exclude it by entering its path, one per line, in "Never minify the following JS files" (or CSS files) in the advanced settings on the same screen
- If that still does not fix it, do not use Minify. Page cache and browser cache alone still help
6. Database cache and object cache
These two features help when your server offers an in-memory cache such as Redis or Memcached. If you choose "Disk" as the method, W3 Total Cache itself shows a warning that it is not recommended because it can be slow depending on the storage device and server configuration, and because it creates a large number of files.
On shared rental hosting where Redis and Memcached are not available, leave them off.
If you use WooCommerce and turn on database cache, WooCommerce shows a notice asking you to add _wc_session_ to "Ignored query stems" (queries that are not cached). Follow the notice and add it.
7. Check that pages are cached
Check while logged out. Open the site twice in a private (incognito) browser window and view the page source. If page cache is working, the W3 Total Cache comment at the end (the part between <!-- and -->) contains this line:
Page Caching using Disk: Enhanced
Sometimes the reason a page was not cached is shown in parentheses after Page Caching using. Use that reason to check your exclusion settings or login state.
8. Exclude pages from the cache
Exclude members-only pages and pages whose content changes depending on who views them. In "Performance" → "Page Cache", enter them one per line in "Never cache the following pages". Regular expressions are supported.
/members/
/contact/
The admin (/wp-admin/) is not page cached, so you do not need to list it. For WooCommerce cart, checkout and similar pages, WooCommerce sets the DONOTCACHEPAGE constant, which means "do not cache", and W3 Total Cache follows it.
9. Clear the cache
When you update a post, the page cache for that post is cleared automatically. To clear everything, for example after a design change, choose "Purge All Caches" from "Performance" in the admin bar. With WP-CLI, use these commands:
# Clear all caches
wp w3-total-cache flush all
# Check whether page cache is enabled
wp w3-total-cache option get pgcache.enabled --type=boolean
If you change settings with WP-CLI's option set, .htaccess is not updated automatically. Run wp w3-total-cache fix_environment afterward.
Related articles
Questions about WordPress? The publisher of this site is based in Japan and replies in Japanese. Contact (Japanese)