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

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Set Cache-Control: public, max-age=3600 on the HTTP response generated by your origin server, application, reverse proxy, or CDN. Headless Chrome cannot add or change that origin response header. It can only receive the header and let you inspect it through the Chrome DevTools Protocol (CDP), Puppeteer, or the DevTools Network panel.

The max-age value is measured in seconds from response generation. An intermediary’s Age value reduces the remaining freshness lifetime. Configure the response where it is emitted, then verify the exact response Chrome receives.

Where Cache-Control is actually configured

Cache-Control is an HTTP response header. The component that serves the resource must emit it. Depending on your deployment, that component is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • your application framework or route handler;
  • a web server such as a reverse proxy;
  • a CDN or edge configuration; or
  • another service that generates the response.

For an hour of freshness, the response should contain:

#1 Best Overall
HP OmniBook 3 17.3 inch Laptop PC, FHD Display, AMD Ryzen 3 30, 8 GB RAM, 512 GB SSD, AMD Radeon 610M Graphics, Windows 11 Home, Mica Silver, 17-dp0199nr
  • FULL HD IPS DISPLAY - Enjoy vibrant, crystal-clear images with 178-degree wide-viewing angles
  • AMD RYZEN 3 30 PROCESSOR - Everyday performance you can count on; Multitask, stream, game casually, and edit photos smoothly with responsive power and vibrant HDR visuals
  • ENJOY UP TO 14 HOURS AND 15 MINUTES OF BATTERY LIFE - HP Fast Charge restores battery from 0 to 50% in approximately 45 minutes
  • AMD RADEON 610M GRAPHICS - Experience smooth entertainment; Built for streaming and multitasking, enjoy realistic visuals and efficient performance for work and play
  • STORAGE AND MEMORY - 512 GB PCIe NVMe M.2 SSD offers fast speed and efficient storage; and 8 GB LPDDR5 RAM memory boosts performance with higher bandwidth
Cache-Control: public, max-age=3600

max-age=3600 means a shared cache may regard the response as fresh for 3,600 seconds after it was generated. Use a different number when your content changes more or less frequently. If the response is user-specific, use an appropriate private policy instead of copying a public policy.

Check the resource, not only the document

A page request, stylesheet, image, API response, and script can each have different cache headers. Decide which URL needs the policy and inspect that URL’s response. Setting a header on your HTML document does not automatically set it on every subresource.

Choose the policy before testing Chrome

Directive Meaning Typical use
max-age=N Fresh for N seconds after generation Any response with a defined freshness period
public, max-age=N Allows shared caches to store the response while it is fresh Public, identical content
private, max-age=N Allows a private browser cache but signals that shared caches should not store it User-specific responses

Use seconds, not minutes or milliseconds. For example, one day is 86400 seconds. The freshness clock starts with response generation; an intermediary that sends an Age header can make the remaining freshness period shorter when Chrome receives the response.

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.

Set the header in the component that serves the response

Application response

In an application route, set the response header before sending the body. The exact API depends on your framework, but the result must be an HTTP response line equivalent to:

Cache-Control: public, max-age=3600

Confirm that no later middleware, reverse proxy, or CDN rule overwrites it. A header shown in application code is not proof that it reached the client; the wire response is authoritative.

Rank #2
HP 14" HD Chromebook Laptop for Students, Intel Quad-Core N4120(> N4020), 4GB RAM, 64GB eMMC, WiFi, Webcam, HDMI, USB-A&C, 14 Hours Battery Life, Zoom, Chrome OS, CUE Accessories
  • Intel Celeron N4120: 4 Cores & Threads, 1.1GHz Base Clock, Up to 2.6GHz Boost Clock, 4MB Cache, Intel UHD Graphics 600. The perfect combination of performance, power consumption, and value helps your device handle multitasking smoothly and reliably with four processing cores to divide up the work.
  • 14" HD Display: 14.0-inch diagonal, HD (1366 x 768), micro-edge, anti-glare. See your digital world in a whole new way. Enjoy movies and photos with the great image quality and high-definition detail of 1 million pixels.
  • Memory & Storage: 4 GB LPDDR4x & 64 GB eMMC Storage. Adequate high-bandwidth RAM to smoothly run multiple applications and browser tabs all at once. An embedded multimedia card provides reliable flash-based storage.
  • Ports:2 x USB 3.0 Type-A,1 x USB 3.0 Type-C,1 x HDMI,1 x Headphone Jack
  • Chrome OS: Chromebook is a computer for the way the modern world works, with thousands of apps. Enjoy the seamless simplicity that comes with Google Chrome and Android apps, all integrated into one laptop. It’s fast, simple, and secure.

Reverse proxy or web server

If a proxy serves static files or adds headers, configure its response-header rule for the relevant location. Keep the rule narrow enough that private endpoints do not inherit a public policy. Reload the proxy after changing configuration, then request the URL directly and inspect the response.

CDN or edge layer

A CDN can replace or add cache directives at the edge. Determine whether the browser is seeing the origin header or an edge-generated one. Purge an old object, if your CDN requires that for configuration changes, and verify a fresh response. Otherwise a previously stored object can continue to show the old policy.

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

Verify the header in headless Chrome

  1. Launch Chromium with remote debugging enabled, for example --headless --remote-debugging-port=9222.
  2. Connect Puppeteer, another automation library, or a direct CDP client.
  3. Enable the Network domain when using CDP directly.
  4. Navigate to the target URL and capture the response for the exact resource you changed.
  5. Read the received cache-control value and compare it with the expected max-age.

Puppeteer verification

This script logs the response header for the document URL. It observes what Chrome received; it does not create the server header.

const puppeteer = require('puppeteer');

const targetUrl = 'https://example.com/';

(async () => {
  const browser = await puppeteer.launch({ headless: true });
  const page = await browser.newPage();

  page.on('response', response => {
    if (response.url() === targetUrl) {
      console.log({
        status: response.status(),
        cacheControl: response.headers()['cache-control'],
        fromCache: response.fromCache(),
        fromServiceWorker: response.fromServiceWorker()
      });
    }
  });

  await page.goto(targetUrl, { waitUntil: 'networkidle0' });
  await browser.close();
})();

For a page that redirects, the final response URL may differ from targetUrl. Log every response, or compare against the final URL, when diagnosing redirects. To inspect an image, stylesheet, or API call, match that resource URL instead of the document URL.

CDP concepts

The CDP Network domain provides request and response instrumentation. A direct client should enable Network before navigation, listen for response events, and inspect the response headers in each event. The important distinction is that CDP exposes the header Chrome received; it cannot rewrite the origin’s response.

Rank #3
Sale
AKCHART 15.6'' AI Laptop with Office 365 12GB RAM 256GB SSD Win 11 Laptops
  • Stunning 15.6" FHD IPS Display: Experience crisp 1920x1080 resolution on this 15.6 inch laptop with an IPS panel that delivers wide viewing angles and vivid colors. The narrow-bezel design maximizes screen real estate for comfortable viewing on this Win 11 laptop, whether you're studying or working.
  • Celeron J4105 Processor & 256GB SSD: Powered by a reliable Celeron J4105 processor paired with 12GB DDR4 memory and a fast 256GB M.2 SSD. This laptop computer supports SSD expansion up to 2TB and TF card expansion up to 1TB, so your storage grows with your needs. Delivers smooth multitasking for daily productivity.
  • AI-Powered Win 11 Laptop: Built-in AI features enhance your productivity with smart assistance for writing, summarizing, and task management. Pre-installed with Win 11 and includes Office 365 subscription. This student laptop is backed by 1-year warranty and 24/7 customer support.
  • All-Day 7000mAh Battery & 180° Hinge: The high-capacity 7000mAh battery keeps this laptop powered through long classes or meetings. The 180-degree lay-flat hinge lets you share your screen effortlessly during presentations. This durable laptop computer adapts to your dynamic workflow.
  • Versatile Connectivity Hub: Equipped with USB 3.2, Type-C, Mini HDMI, and 3.5mm audio jack to connect all your peripherals. Stay online anywhere with high-speed 5G WiFi and Bluetooth 4.2. This college laptop keeps you connected at home, in the library, or on the go.

DevTools Network panel

In a headed debugging session, open the Network panel, reload the page, select the request, and view the Headers tab. Searching for Cache-Control takes you to the matching header. The same response may also show whether it came from memory or disk cache, which is useful when interpreting a reload.

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

Do not confuse cache bypass with setting max-age

The CDP method Network.setCacheDisabled is a diagnostic switch. When enabled, Chrome ignores its cache for requests. The DevTools Network-panel Disable cache checkbox has the same testing purpose while DevTools is open. Neither control adds, edits, or persists a Cache-Control response header.

Use cache bypass when you need to test a fresh network response. Turn it off when you need to observe normal cache behavior. Always verify the server policy separately.

Understand reload, freshness, and revalidation

A normal navigation can reuse a fresh cached response without contacting the origin. When the freshness lifetime expires, Chrome can make a conditional request using validators such as ETag or Last-Modified. A conditional response can be 304 Not Modified rather than a full body.

Chrome’s refresh behavior can send a request directive with max-age=0, asking caches to revalidate. Therefore, a refresh that reaches the server does not prove that your response was never cached, and a reload that appears instant does not prove that the origin header is missing. Inspect request and response headers and the cache-status indicators together.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
HP Essential Laptop 2026, Intel CPU, 128GB Storage, Office 365, Windows 11
  • Efficient Performance for Everyday Computing: Powered by Intel N150 processor with up to 3.6 GHz Intel Turbo Boost Technology, 6 MB L3 cache, 4 cores, and 4 threads, this HP laptop delivers responsive performance for web browsing, streaming, document editing, and multitasking. Paired with 4GB LPDDR5 RAM and 128GB UFS storage, it handles daily tasks smoothly. Includes 1-year Microsoft 365 Personal subscription for Word, Excel, PowerPoint, and cloud storage to maximize your productivity.
  • 14-Inch HD Micro-Edge Display:Enjoy clear visuals on the 14-inch HD (1366 x 768) anti-glare screen with 250-nit brightness and 62.5% sRGB coverage. The micro-edge bezel delivers a 79% screen-to-body ratio in a compact design. An HP True Vision 720p HD camera with noise reduction and dual-array microphones supports clear video calls, remote work, and online learning.
  • Modern Connectivity and Wireless Technology: Stay connected with Wi-Fi 6 (2x2) for faster wireless speeds and Bluetooth 5.4 for seamless pairing with accessories. Versatile port selection includes 1 USB Type-C 10Gbps with DisplayPort 1.2 for external displays, 2 USB Type-A 5Gbps ports for peripherals, 1 HDMI 1.4b port, 1 headphone/microphone combo jack, and 1 multi-format SD media card reader. Connect monitors, transfer files quickly, and expand your workspace with ease.
  • All-Day Battery Life and Portable Design: Enjoy up to 11 hours of video playback, 7.5 hours of mixed usage, or 7.5 hours of wireless streaming on a single charge, perfect for students and professionals on the go. Weighing just 3.24 lb and measuring 12.76" x 8.86" x 0.71", this lightweight laptop fits easily in backpacks and bags. The stylish willow green top cover with matte finish and natural silver keyboard deck with vertical brushing pattern offer a modern, professional look.
  • AI-Enhanced Productivity: Access Microsoft Copilot instantly with the dedicated Copilot key for faster assistance. AI Noise Reduction filters background sounds and improves voice clarity during calls. Dual speakers provide clear audio, while the full-size natural silver keyboard and HP Imagepad support comfortable typing and navigation.

Troubleshooting common failures

The header is absent

  • Cause: You changed a component that does not serve the requested resource.
  • Fix: Inspect the response URL in Chrome, then configure the application, proxy, or CDN layer that actually emitted it.

The value is different from your configuration

  • Cause: A later middleware or edge rule overwrote the header, or Chrome received an older cached object.
  • Fix: Compare the origin response with the client response, purge or bypass the relevant cache for testing, and locate the last component that changes the header.

Chrome appears to ignore max-age

  • Cause: The response is stale, a refresh requested revalidation, the request is bypassing cache, or the resource is controlled by a service worker.
  • Fix: Check request directives, response headers, cache source indicators, and service-worker status. Test once with cache bypass and once with normal caching.

Only some assets cache

  • Cause: Different resources are generated by different handlers or have different policies.
  • Fix: Capture and inspect each resource type separately; do not infer an image or API policy from the HTML document.

The script logs nothing

  • Cause: The URL comparison missed a redirect, query-string variation, or trailing slash.
  • Fix: Log all response URLs first, then match the final URL or use a URL parser rather than a literal string comparison.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Operational guidance

Pick a lifetime that matches change frequency

Longer lifetimes reduce repeated transfers but delay visible updates until expiry or an explicit revalidation. Shorter lifetimes make updates appear sooner while increasing origin or intermediary checks. For versioned assets, a long lifetime is safer because changing the filename creates a new URL; for unversioned HTML or APIs, choose a period that matches how quickly clients must see changes.

Verify through every caching layer

Test the origin directly when possible, then test the public URL through the CDN or reverse proxy. Record Cache-Control, any Age value, status code, validators, and whether the response came from memory, disk, a service worker, or the network. This prevents a browser-only observation from hiding an edge configuration problem.

Use repeatable automation

Run the same headless check after deployments. Assert that the expected directive is present, but allow for redirects and resources whose policy is intentionally different. A failed assertion should identify the response URL and the complete received header so the faulty layer is clear.

Or skip the browser setup

If your goal is a clean visual capture while you diagnose or document a page, ScreenshotNeo can take the screenshot through one request. It is separate from configuring your origin’s Cache-Control header, but it avoids maintaining a browser-capture stack.

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

ScreenshotNeo removes cookie-consent banners, newsletter popups, and chat widgets before capture. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and each response identifies the page verdict and billing status in X-Page-Verdict and X-Billed headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The Free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 screenshots. Every plan includes all features.

Use the ScreenshotNeo documentation for options such as full-page capture, CSS-selector element capture, device and retina settings, custom headers and cookies, waiting conditions, request blocking, PDF output, signed links, asynchronous jobs, and bulk capture.

Best Value
Sale
HP 14 Laptop Computer, 2027 Edition, Intel N150 CPU, 4GB RAM, 128GB SSD, 1TB Cloud Storage, Win 11 with Microsoft 365
  • 【Expansive Display】The 14 Non-touch display offers clear and vibrant visuals, and anti-glare coating, perfect for both work and entertainment.
  • Designed for mobility with a slim 0.71-inch profile and lightweight 3.24 lb chassis, making it easy to carry between home, office, school
  • 【Versatile Connectivity】Stay connected with multiple ports including USB 3.0 Type-C, USB 3.0 Type-A, HDMI, and a headphone/mic combo jack, along with Wi-Fi and Bluetooth for seamless wireless networking.
  • One Year Microsoft 365
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.

Frequently Asked Questions

Does setting a request header in Puppeteer set the response Cache-Control header?

No. Request headers travel from Chrome to the server. Cache-Control max-age in this context must be emitted by the server in its response.

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

What does an Age header change?

It represents time an intermediary has held the response, so the remaining freshness period can be less than the original max-age value.

Can a 304 response contain the original response body?

No. A 304 tells the cache that its stored representation can be reused; inspect the stored response’s cache policy and validators.

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.