DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk3 min

How to Check Whether a Puppeteer Response Came from Cache

Check Puppeteer’s HTTPResponse.fromCache() flag, distinguish service-worker delivery, and use requestservedfromcache or CDP for deeper diagnostics.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Call response.fromCache() on the Puppeteer HTTPResponse to check whether Chrome served that response from its disk or memory cache. Check response.fromServiceWorker() separately: service-worker delivery is a distinct source, not an ordinary browser-cache hit.

Check the response object directly

Listen for the response event and inspect the response’s cache flags. The event supplies an HTTPResponse; its request() method returns the associated HTTPRequest if you also need request details.

As an Amazon Associate I earn from qualifying purchases.

page.on('response', response => {
  console.log({
    url: response.url(),
    fromBrowserCache: response.fromCache(),
    fromServiceWorker: response.fromServiceWorker(),
  });
});

Keep the two booleans separate in logs and reports. A true value from fromCache() indicates disk or memory cache according to Puppeteer’s current API reference; fromServiceWorker() identifies service-worker delivery. The current HTTPResponse reference displayed Puppeteer version 25.12.0 when checked on October 3, 2026. For older installations, consult the API documentation matching your installed version. Puppeteer HTTPResponse API

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use the cache event for a request-level signal

Puppeteer also emits requestservedfromcache when a request ends up loading from cache. Its listener receives an HTTPRequest, but the documented payload can be undefined for certain requests, so guard against a missing value.

page.on('requestservedfromcache', request => {
  if (!request) {
    console.log('Cache event fired without a request object');
    return;
  }

  console.log('Request loaded from cache:', request.url());
});

Use this event when you want to react to a request-level cache signal. Use the response listener when you want the cache flags attached to each delivered response. Puppeteer PageEvent reference

When you need Chrome’s more detailed cache source

Puppeteer’s fromCache() is a convenient browser-cache check. For more detailed classification, Chrome DevTools Protocol’s Network.Response schema defines separate optional flags: fromDiskCache, fromServiceWorker and fromPrefetchCache. These fields distinguish delivery paths that an umbrella cache result may not explain. The protocol’s tot documentation is a living reference, so check the documentation corresponding to your Chrome version when diagnosing version-specific behavior. Chrome DevTools Protocol Network.Response

What not to use as a cache test

Use the documented cache-source flags rather than inferring cache delivery from a fast response, its status code or its headers. Those may be useful diagnostic clues, but they do not substitute for Puppeteer’s explicit cache methods or CDP’s source fields.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Troubleshoot misleading or missing results

  • The response listener says false, but the page felt fast: response speed alone does not establish cache delivery. Record the explicit flags instead.
  • You see service-worker responses: inspect and log fromServiceWorker() separately rather than treating them as disk or memory cache hits.
  • The cache event fires without a request: handle an undefined payload before calling url(); this missing-payload case is documented for certain requests.
  • You need to distinguish disk cache from prefetch cache: inspect CDP’s separate fromDiskCache and fromPrefetchCache fields, along with fromServiceWorker.
  • Your installed version behaves differently: the cited Puppeteer reference reflects version 25.12.0 as of October 3, 2026, and does not establish behavior across every historical version. Check the documentation for your installed Puppeteer and Chrome versions.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your goal is to get a screenshot rather than diagnose Chrome’s cache behavior, ScreenshotNeo provides a website screenshot API and MCP server. For example, one GET request can return a screenshot:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for request options. Cookie banners are accepted and removed before capture, along with supported newsletter popups and chat widgets. Bot checks, blank pages, failed loads and cache hits are not billed. An MCP server lets AI agents take screenshots, and the Free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Learn about ScreenshotNeo, or sign up free.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.