Speed & performance · Info
W3 Total Cache Browser Cache Settings Explained: What Each Option Does

Short answer
W3 Total Cache's browser cache settings add HTTP headers that tell browsers how long to keep CSS, JavaScript, images and pages. Turn on Cache-Control, Expires and compression, use long lifetimes for static files and a short, validated lifetime for HTML, then check the headers in your browser's Network tab.
Key takeaways
- Browser cache stores static files on visitors' devices, unlike page cache.
- Cache-Control with a long max-age matters most for speed audits.
- Use one-year lifetimes for CSS, JavaScript, images and fonts.
- Keep HTML lifetimes short so visitors see fresh content.
- Nginx users must include the plugin's generated config file.
- Security headers live here too but need careful testing.
What do W3 Total Cache browser cache settings do?
W3 Total Cache's browser cache settings add HTTP headers that tell visitors' browsers how long to keep files like CSS, JavaScript and images, so repeat visits load those files from the device instead of your server.
Browser caching is different from page caching. Page cache stores finished HTML on your server. Browser cache stores static files on the visitor's computer or phone.
If you are new to caching, our guide on how a cache plugin helps on LiteSpeed hosting explains how the different cache layers fit together.
In W3 Total Cache, you switch the feature on in Performance > General Settings > Browser Cache, then configure it under Performance > Browser Cache. The page has four main parts:
| Section | What it controls |
|---|---|
| General | Headers and options that apply to every file type |
| CSS & JS | Cache rules for stylesheets and scripts |
| HTML & XML | Cache rules for pages and feeds |
| Media & Other Files | Cache rules for images, fonts, video and documents |
| Security Headers | Optional headers such as HSTS and X-Frame-Options |
Each section is explained below. Exact labels can shift between plugin versions, so check the W3 Total Cache plugin page for current release notes.
What are the General browser cache options?
The General section sets the default headers for all file types, including Last-Modified, Expires, Cache-Control and ETag, plus compression and an option to bust caches when settings change.
Here is what each option means:
- Set Last-Modified header. Sends the file's last change date, so browsers can ask if anything is new.
- Set expires header. Sends a date after which the browser should check again.
- Set cache control header. Sends the modern
Cache-Controlheader with a max-age. This matters most. - Set entity tag (ETag). Sends a fingerprint of the file, used to check if it changed.
- Set W3 Total Cache header. Adds a header showing the plugin served the response. Useful for debugging, optional otherwise.
- Enable HTTP (gzip) compression. Compresses text files before sending.
- Enable HTTP (brotli) compression. Better compression where the server supports it.
- Prevent caching of objects after settings change. Adds a version string to file URLs so browsers fetch new copies.
- Disable cookies for static files. Stops cookies being sent with static file requests.
- Do not process 404 errors for static objects with WordPress. Lets the web server handle missing images and files, saving PHP work.
MDN's Cache-Control reference explains each directive in detail.
Which headers should I turn on?
Turn on Cache-Control and Expires with long lifetimes for static files, keep Last-Modified on, enable gzip or brotli compression, and enable the option that prevents caching after settings change.
Why these matter:
Cache-Controlwith a long max-age is what tools like Lighthouse check. Google's efficient cache policy audit flags short lifetimes.Expiresis older but still helps some clients.- Compression shrinks HTML, CSS and JavaScript a lot.
ETag is optional. It helps validation, but on servers with several machines behind a load balancer, ETags can differ per machine and cause needless downloads. Many people leave it on for single-server hosting.
Our W3 Total Cache recommended settings guide shows a full starting setup across all modules.
What do the CSS & JS settings do?
The CSS & JS section sets how long browsers keep stylesheets and scripts, using an expires lifetime in seconds and a cache control policy, plus file-specific options like compression for those types.
The key fields:
- Expires header lifetime. How many seconds browsers keep the file. Long values like one year (31536000 seconds) are common for static assets.
- Cache Control policy. How the browser should treat the file. Options typically include cache with max-age, cache with validation, cache with max-age and validation, and no cache.
Long lifetimes are safe when file URLs change after updates. The Prevent caching of objects after settings change option and WordPress's own version strings handle this for most theme and plugin files.
If you edit a CSS file by hand and visitors do not see the change, that is the long cache at work. Clear the cache and bump the version, as shown in how to clear W3 Total Cache.
What do the HTML & XML settings do?
The HTML & XML section controls browser caching of pages and feeds, and it should use a short lifetime or validation-only caching, because pages change more often than static files.
If browsers keep HTML for a long time, visitors may see old content after you publish an update. They may also see outdated cart or login states.
Safe choices for HTML:
- A short expires lifetime, such as an hour.
- A cache control policy that requires validation, so browsers check before reusing the page.
Logged-in users and WooCommerce cart pages need special care. Your page cache settings should already exclude them, but check them after any change.
What do the Media & Other Files settings do?
The Media & Other Files section covers images, fonts, video, audio and documents, and these can almost always use the longest lifetime because they rarely change once uploaded.
When you replace an image in WordPress, it usually gets a new file name. That means a long lifetime has little downside.
Typical settings:
- Expires header lifetime: one year.
- Cache Control policy: cache with max-age.
- Compression: on for SVG and text formats, not needed for already-compressed formats like JPEG, PNG and WebP.
Fonts are a common miss. Make sure font files such as .woff2 get a long lifetime, because they block text rendering on first load.
What are the Security Headers options?
The Security Headers section can add headers such as HTTP Strict Transport Security, X-Frame-Options, X-Content-Type-Options, Referrer-Policy and Content Security Policy, which improve security but can break features if set wrongly.
These headers are not about caching. W3 Total Cache simply offers them here because it already writes server rules.
Use them carefully:
- HSTS forces HTTPS. Only enable it once your whole site works on HTTPS.
- X-Frame-Options stops other sites framing yours. It can break embeds you rely on.
- Content Security Policy is powerful but easy to misconfigure. Start in report-only mode if available.
See how to add security headers to WordPress before turning these on.
For the most complex header, read how to add a Content Security Policy first.
How does browser cache work with a CDN or Nginx?
On Apache, W3 Total Cache writes browser cache rules to .htaccess automatically; on Nginx, it writes an nginx.conf file you must include in your server config, and a CDN may override headers with its own rules.
Common situations:
- Apache or LiteSpeed. Rules apply right away after saving, as long as
.htaccessis writable. - Nginx. Include the plugin's generated config in your server block, then reload Nginx. Without this step, nothing changes.
- CDN such as Cloudflare. The CDN may respect your origin headers or replace them. Check its cache settings, such as Cloudflare cache rules.
- Managed hosts. Many set their own headers at server level. W3 Total Cache settings may be ignored.
The web.dev HTTP cache guide explains how browsers, CDNs and servers decide which headers win.
How do I check that browser caching works?
Open your site in Chrome, press F12, go to the Network tab, reload, click a CSS or image file, and look for Cache-Control and Expires in the response headers.
What to look for:
Cache-Control: max-age=31536000or similar on static files.- A future
Expiresdate. content-encoding: gziporbron CSS and JavaScript.- (disk cache) or (memory cache) in the Size column on a second reload.
If headers are missing, check your server type and whether a host or CDN overrides them. For more help with the plugin itself, see what is W3 Total Cache.
What are good default browser cache settings?
For most sites, enable Cache-Control, Expires and Last-Modified, turn on compression, use one-year lifetimes for CSS, JavaScript and media, and a short, validated lifetime for HTML.
A simple reference:
| File type | Expires lifetime | Cache Control policy |
|---|---|---|
| CSS and JS | 1 year | Cache with max-age |
| Media and fonts | 1 year | Cache with max-age |
| HTML and XML | About 1 hour | Cache with validation |
Test the site after saving. Check logged-in pages, forms and carts, then run a speed test to confirm the cache policy warning is gone.
Frequently asked questions
Where are the browser cache settings in W3 Total Cache?
Enable Browser Cache in Performance, then General Settings. Then open Performance and choose Browser Cache to configure headers, lifetimes and policies for CSS and JS, HTML and XML, media files and security headers.
What expires lifetime should I use for images?
Most sites use one year for images, fonts and other media because these files rarely change after upload. Replacing an image in WordPress usually creates a new file name, so long lifetimes rarely cause visitors to see outdated images.
Should I enable ETag in W3 Total Cache?
It is optional. ETags help browsers check whether a file changed. On single-server hosting they work fine. On setups with several servers behind a load balancer, they can differ between machines and cause unnecessary downloads, so some admins turn them off.
Why are my browser cache headers not showing?
On Nginx you must include the plugin's generated config file and reload the server. On Apache, check that the htaccess file is writable. A CDN or managed host may also override the headers with its own caching rules.
Will long browser caching stop visitors seeing my CSS changes?
It can if the file URL stays the same. Enable the option that prevents caching after settings change, clear the plugin cache after editing, and rely on WordPress version strings, which change file URLs when themes and plugins update.
Sources
- W3 Total Cache WordPress.org Plugins
- Cache-Control MDN Web Docs
- Prevent unnecessary network requests with the HTTP Cache web.dev
- Serve static assets with an efficient cache policy Chrome for Developers
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
Related guides
About the editors
Researched from the primary sources listed above and checked against our editorial rules before publishing.


