1. Home
  2. Blog
  3. Performance

Pick a Browser Cache Strategy for WordPress Without Serving Stale Pages

Performance

October 13, 2026

Page caching gets all the attention, but there is a second cache that lives on your visitor’s own device. It decides whether a returning visitor’s request goes to your server at all. Get it right and repeat visits feel instant. Get it wrong and someone sees yesterday’s price, an old menu, or a post you already corrected. Choosing a WordPress browser cache strategy is a small setting with a big effect on both speed and freshness.

Lightify handles the browser cache with a service worker and gives you five strategies plus an expiration time. This guide explains what each strategy does, which one fits which kind of site, how expiration changes the risk, and how to fix the “I published it but I still see the old version” problem when it happens.

Three caches, three different jobs

Lightify’s Cache tab covers three layers. They are easy to confuse, so here is the short version.

LayerWhere it livesWhat it speeds up
Page cacheYour server’s diskEvery visitor, by serving finished HTML instead of running PHP and database queries
Browser cacheThe visitor’s device, via a service workerRepeat requests from the same visitor
Object cacheServer memory (Redis or Memcached)wp-admin, logged-in pages, and WooCommerce requests the page cache cannot help

The page cache is the largest single improvement Lightify offers and needs no configuration. The object cache section is informational: Lightify tells you whether Redis or Memcached is available, but does not install anything. The browser cache is the one you actively choose a strategy for, and that choice is what this guide is about.

Everything on the Cache tab is free. There is no Pro gate on the browser cache strategy or its expiration time.

How Lightify’s browser cache works

Lightify registers a service worker for your site. A service worker is a small script the browser runs in the background, and it can answer a request from the device’s own storage or pass it to the network. Lightify generates that script from your settings and stores it with its optimized assets under wp-content/uploads/lightify/.

You control it from Lightify > Settings > Cache > Browser cache with two fields:

  • Caching Strategy, default NetworkFirst.
  • Cache Expiration Time, in days, default 10.

In the settings array these are browserCacheStrategy and browserCacheExpirationTime, which is handy if you configure sites in code. Lightify’s documentation prefers the settings screen or the PUT /settings REST endpoint over writing the option directly, because both merge your values over the stored ones and fire the update hooks.

The five strategies, explained

StrategyBehaviorBest for
Network-FirstTries the network, caches the response, falls back to the cached copy on failureMost sites
Stale While RevalidateServes the cache immediately, updates it in the backgroundSpeed over freshness
Cache-FirstServes the cache, only uses the network when nothing is cachedRarely changing sites
Network-OnlyNever cachesPages that must never be stale
Cache-OnlyOnly ever serves the cacheFixed content

Network-First

The default, and the right choice for most WordPress sites. Every request goes to the network first, so visitors see your latest content whenever they have a connection. The response is saved, and if the network fails, the saved copy is shown instead. You get resilience on flaky mobile connections without risking stale pages when the connection is fine.

The trade is that a repeat visit still waits for the network. With a good page cache on the server, that wait is short, which is why Network-First pairs well with the rest of Lightify.

Stale While Revalidate

The visitor gets the cached copy instantly, and the browser fetches a fresh one in the background for next time. Repeat visits feel immediate. The catch is in the name: the page shown is the one from the previous visit. If you changed something since, that visitor sees the change one visit later.

This works well for blogs and documentation where a one-visit delay on an edit does not hurt anyone. It is a poor fit for prices, stock levels, event times, or anything a visitor might act on.

Cache-First

Once a page is cached, the network is not consulted at all until the cache expires. That is fast and light on your server, and it is also the strategy most likely to cause support emails. Lightify’s docs warn that with Cache-First, the expiration time is the longest a visitor can be stuck with an old page, so lower it if you use this strategy.

Reserve it for sites that genuinely change rarely, like a brochure site that is updated a few times a year.

Network-Only

Nothing is cached in the browser. Every request goes to the network. Use it when freshness matters more than repeat-visit speed for the whole site, or when you are debugging and want to rule the browser cache out entirely.

Cache-Only

The service worker only ever answers from its cache. This is for fixed content that never changes after it is first stored. For a typical WordPress site that publishes, edits, or sells anything, it is the wrong choice.

The docs put the warning plainly: Cache-First and Cache-Only will serve stale pages to returning visitors after you publish changes. On a news site or a store with changing prices, do not use them.

Matching a strategy to your site

Here is a practical starting point by site type.

SiteStrategyExpiration
WooCommerce storeNetwork-FirstDefault 10 days is fine, since the network is tried first
News or frequently updated blogNetwork-FirstDefault
Evergreen blog or docsStale While RevalidateDefault or lower
Brochure site updated a few times a yearCache-FirstLow, a few days
Booking, ticketing, or live dataNetwork-First or Network-OnlyDefault

If you are unsure, leave it at Network-First. It is the default for a reason, and the speed difference between strategies matters less than getting your page cache, images, and scripts right.

How expiration time changes the risk

Cache Expiration Time is the number of days before cached content expires in the browser. How much it matters depends on the strategy:

  • Network-First. The network is tried first, so expiration mainly affects how long a saved fallback copy can be used when the connection drops.
  • Stale While Revalidate. Expiration caps how long an old copy can keep being served first, which matters if background updates keep failing.
  • Cache-First and Cache-Only. Expiration is effectively your staleness ceiling. Ten days of Cache-First means a returning visitor can see a ten-day-old page.

If you ever pick a cache-heavy strategy, set expiration to the longest period you would be comfortable with someone seeing an outdated page. For most businesses that is not ten days.

When Progressify is installed

Progressify, DaftPlug’s PWA plugin, also uses a service worker. Two service workers on the same scope would fight, so only one registers. If Progressify is active, it owns the service worker and Lightify’s browser cache section shows Handled by Progressify with the fields disabled.

Nothing needs configuring in that case. You choose the caching strategy in Progressify’s Offline usage settings instead, and Lightify carries on with page caching and optimization as normal.

“I published a change and still see the old page”

This is the most common browser cache complaint, and it usually has a simple cause. Lightify’s troubleshooting guide gives the order:

  1. Purge Lightify. Use the admin bar on any page. “Purge current page” rebuilds the page you are viewing.
  2. Purge your CDN. If you use Cloudflare without the official plugin, Lightify cannot purge it for you.
  3. Purge your host’s cache. Lightify’s free integrations propagate purges to Cloudflare, Varnish, and several managed hosts automatically when they are detected.
  4. Check your own browser. If it only happens for you, it may be your browser’s service worker cache. Open developer tools, go to Application > Service Workers, and unregister it, then reload. Or lower the cache expiration.

Point 4 is why editors often see stale pages when visitors do not. Editors visit the same pages over and over, so their devices have the most cached copies. The related guide on keeping Cloudflare, Varnish, and host caches in sync covers the server-side layers in detail.

If the complaint comes from real visitors rather than editors, look at your strategy first. Stale pages for visitors under Network-First are unusual and point to a server or CDN layer. Under Cache-First or Stale While Revalidate, it is expected behavior.

Testing a strategy change

After you change the strategy, existing visitors still have the old service worker until their browser picks up the new one. To test cleanly:

  1. Save the setting, then use Purge everything and preload from the admin bar. Lightify recommends a full purge after any settings change, since existing cached pages were built under the old settings.
  2. Open the site in a private window or a fresh browser profile.
  3. In developer tools, open Application > Service Workers and confirm one is registered and activated.
  4. Open the Network panel, reload, and look at which responses came from the service worker.
  5. Edit a test post, reload as a returning visitor, and confirm the change appears when you expect it to under the strategy you chose.

For developers: the service worker filter

Lightify exposes lightify_serviceworker, which filters the generated service worker source before it is written. The docs are firm about how to use it: append rather than rewrite, and check the result in Application > Service Workers. A syntax error stops the service worker registering, which disables browser caching site-wide.

After changing that filter, rebuild the file with the REST endpoint POST /service-worker/generate, which regenerates the service worker from current settings.

There is also lightify_offline_fallback_page, which sets the page served when a visitor is offline and the request is not cached. Its default is /404/, so if you want a friendlier offline message, point it at a page you have written for that purpose.

Common mistakes

  • Choosing Cache-First for speed on a store. Returning shoppers can see old prices or stock. Use Network-First.
  • Leaving a long expiration with a cache-heavy strategy. Ten days is a long time for a stale page.
  • Blaming the page cache for a browser cache issue. If only one person sees the old page, check their service worker first.
  • Running two PWA or service worker plugins. Let one own the scope. With Progressify, that is automatic.
  • Editing the service worker filter without testing. A broken file silently turns off browser caching everywhere.

FAQ

Is the browser cache strategy a Pro feature?

No. The browser cache strategy and expiration are free, along with everything else on Lightify’s Cache tab.

Does the browser cache replace page caching?

No. The page cache speeds up every visitor, including first-time ones, by serving finished HTML from your server. The browser cache only helps repeat requests from the same device. You want both.

Why are the fields greyed out?

Progressify is active and owns the service worker. Set the caching strategy there instead.

What should I choose for WooCommerce?

Network-First. Lightify’s WooCommerce integration already excludes cart, checkout, and account pages from the page cache, and Network-First keeps product pages fresh for returning shoppers while still giving them a fallback if their connection drops.

Will changing the strategy hurt my Core Web Vitals score?

Rarely in a way you will notice. The bigger wins are usually elsewhere: the page cache, images, unused CSS, and delayed scripts. Do not trade freshness for a small repeat-visit speed gain.

Wrap up

Leave Network-First in place unless you have a clear reason to change it. Move to Stale While Revalidate for evergreen content where a one-visit delay is fine, and only use Cache-First with a short expiration on sites that barely change. When someone reports a stale page, purge from the outside in and check their service worker before touching anything else.

The browser cache, page cache, and object cache detection are all free in Lightify. Pro adds unused CSS removal, delayed JavaScript, WebP conversion, and critical image preloading as part of the DaftPlug membership. Compare plans on the pricing page.