Skip to content

A service worker shows old content after your site updates

Compare service worker caches with the public response when a browser shows old content, and verify the update path without confusing it with crawl delay.

By Crawlito · 5 min read

In short

  • A service worker can serve a browser a different cached response from the current network response.
  • An installed update may be waiting while older pages remain controlled.
  • Verify both a returning browser and a fresh visit after changing the update strategy.
On this page

If a browser shows an old article while a direct request returns the new one, check the service worker before assuming the search crawler has stale content. A worker can answer a controlled page from its own cache. Compare the network response, the browser's active worker, and the cached document, then repair the update path that serves the old version.

This diagnosis matters when a content team and an audit report disagree. Both may have captured real responses from different layers. Neither a screenshot nor a command-line fetch alone explains what every visitor received.

Establish two dated content markers

Choose one short sentence that changed and one sentence that stayed the same. Record the intended publication time and the exact URL. A visible copyright year is a poor marker if it comes from a shared footer rather than the article.

Save the public response:

bash
curl -sS -L -D response-headers.txt -o current-page.html \
  'https://www.example.com/help/import'

Search the saved body for the new sentence. Then inspect the same sentence in the affected browser. If the direct response is also old, investigate the origin or CDN before attributing the issue to a service worker.

Keep redirects and language variants in the record. A browser on one locale and curl on another may correctly receive different text. Confirm that the final URL and content language match.

The CDN freshness guide covers stale public delivery. This article concerns the additional browser-controlled layer that can remain stale even after that public response is correct.

Inspect the worker that controls the page

In browser developer tools, open the service worker section under application or storage tools. Record the registration scope, active worker, and any installed worker waiting to activate. Check whether the affected page is within that scope.

The service worker lifecycle guide explains that a newly installed worker can wait while an older worker still controls clients. Installation and activation are different states. A deployment can therefore succeed without every open browser tab immediately using the new worker.

Inspect the Network panel for evidence that the document or content request was served by a worker. Look at the cached response where the browser tools expose it. Compare its text with the saved network document.

Do not clear all storage immediately. Doing so may remove the state you need to reproduce the issue. First save the worker identity, cache names, affected response, and open-tab conditions. A screenshot that only says “old article” is harder to act on than a named cached entry containing the old sentence.

Reproduce the returning-visitor path

Use a separate test profile so you can compare a fresh visitor with an existing controlled client. Open the old release, keep the tab open, publish the corrected release in your test environment, and navigate as a returning reader would.

Test a direct reload, a link to another article, and a return to the original page. Record whether the new worker is active at each step. Closing every test tab may change the lifecycle, so label that case separately.

A hypothetical result might look like this:

Client stateObserved article
Direct network fetchNew version
Existing controlled tabOld version
Fresh browser profileNew version
Existing profile after worker updateNew version

These are diagnostic examples, not measured results from a customer. Your own matrix may point elsewhere. If both fresh and returning browsers receive the old version, recheck the network response they actually requested.

For pages that fetch content after load, inspect the API response as well as the navigation document. A current shell can still read an old cached JSON entry.

Repair the cache strategy and the update experience

Find the code or framework configuration that selects cached responses. Determine whether navigation documents, public API responses, and versioned static assets share the same rule. They have different freshness needs.

An article correction should have a defined route to readers. You might fetch fresh content when online, update a cache after a successful response, or show an update prompt when a new application version is ready. Choose a strategy that matches the site's offline requirements and framework.

Do not add unconditional immediate activation without checking compatibility. An old page using a new worker can combine resources from different releases. The lifecycle guide describes why the waiting phase exists; bypassing it should be an intentional design decision.

Remove obsolete entries through the application's supported cache migration path. Keep current resources needed by open clients. A broad “delete every cache” snippet can affect other application features and hides the ownership of the original stale entry.

The conditional request guide is useful when your update path relies on validators. A correct worker strategy still needs the server to identify content changes honestly.

Verify the fix through a second content release

A repair that works only because you manually cleared storage is incomplete. Repeat the returning-visitor sequence with another harmless content change in a test environment. Confirm the application itself moves the reader to the intended version.

Check the network document, rendered article, and content API independently. Save the marker and worker state after each transition. Include a period offline if offline use is part of the product's actual promise.

Inspect failure behavior when the network request cannot complete. An offline copy may be appropriate, but the page should not imply that old operational instructions are the current online version. Use a visible freshness indication where it helps readers make a real decision.

Avoid making that label a substitute for a working update path. If the product is meant to show current guidance while online, verify that behavior directly.

For a release ticket, define completion as “a previously controlled browser receives the corrected instructions through the supported update flow.” This is stronger than “new build deployed” and more useful than a promise about when a search engine changes its copy.

Separate browser state from crawler observations

A service worker incident does not prove that an AI crawler used the same worker or cache. Operator processing differs, and your browser profile is not evidence of the crawler's state.

Compare dated observations. The public page might be current while a search result reflects an older crawl. Or the browser may be stale while the fetched page is already current. Those are separate timelines, and fixing one does not establish the other.

The content refresh guide explains why changes should be tied to substantive facts rather than just dates. Keep the actual corrected text in your evidence so a later reviewer can identify which version was delivered.

For an agency report, state both findings plainly: the network response contained the revised answer, while the returning-browser path served an older cached copy. That gives developers a precise defect without claiming a search penalty or a universal crawler failure.

Frequently asked questions

Does a hard refresh prove all visitors have the update?

No. A forced reload is a different path from an ordinary returning visit. Verify the normal application update flow as well.

Is an installed worker always the active worker?

No. A new worker may be installed and waiting. Inspect the lifecycle state and the client currently under its control.

Should I disable offline support for SEO?

Not merely because one page is stale. Repair the confirmed cache and update behavior, then assess public content delivery separately.

Run the public URL through the free Crawlito check and compare that result with the returning-browser evidence.

Filed under Rendering and content. Topics: javascript, rendering, caching