---
name: interpret-http-cache-freshness
description: "Decide whether a stored HTTP response may be reused, must be revalidated or must not be stored, by applying RFC 9111 to its Cache-Control, Expires, Date and Age headers for a browser or shared cache. Use when someone asks if a cached page or API response is fresh or stale."
license: CC-BY-4.0
metadata:
  author: Raq.com
  version: "2026-11-22"
  homepage: https://skills.raq.com/skills/interpret-http-cache-freshness
---

# Interpret cache freshness from response headers

Determine whether a stored response with an explicit caching policy may be reused at a stated age.

## When to use this skill

- Someone has response headers and asks how long a browser or CDN may reuse the response.
- A CDN or proxy serves stale content, or revalidates on every request, and the team wants to know what the headers allow.
- A developer is choosing between no-cache, no-store, max-age and s-maxage and wants to check what a given header will do.

## When not to use it

- Vendor-specific CDN settings and targeted headers such as Surrogate-Control or CDN-Cache-Control, which can override the standard ones. Check that vendor's documentation.
- Responses with no explicit lifetime. RFC 9111 lets caches estimate a heuristic lifetime, often from Last-Modified, so the answer depends on that cache's own algorithm.
- Back and forward navigation in a browser, which can restore a page from the back/forward cache without revalidating.

## What you need

- Cache type, response Cache-Control and either calculated current age or the request, response and assessment times with Date and Age evidence.
- A simple cacheable GET response and any request directives, status or validation conditions that alter reuse.

## Ask before you start

If any of these are missing or unclear, ask before doing the work.

- Is the cache a private browser cache or a shared cache such as a CDN or proxy? s-maxage and private apply differently to each.
- Can you supply all the response headers (Cache-Control, Expires, Date, Age, Vary, ETag or Last-Modified) and the request headers, including any Cache-Control or Authorization?
- Do you know the response's current age, or the request, response and assessment times? Freshness compares age with lifetime.
- Is it a GET with a cacheable status such as 200? Other methods and statuses have their own rules.

## Method

1. Confirm the basics: a GET (or other cacheable method) with a cacheable status, and whether the cache is private or shared. A shared cache must not store a response to a request carrying Authorization unless a directive such as public, s-maxage or must-revalidate allows it.
2. Check storage first. no-store on the response means do-not-store. An unqualified private directive means a shared cache must not store the response; a browser cache may.
3. Check mandatory validation. Unqualified no-cache on the response means every reuse must be validated with the origin, even while fresh. A no-cache request directive asks for validation before reuse. Either gives validate.
4. Find the freshness lifetime, first match wins: s-maxage in a shared cache, then max-age, then Expires minus Date (or minus the receipt time if Date is absent). Ignore Expires when max-age is present, and in a shared cache when s-maxage is present. An invalid Expires such as 0 means already expired.
5. Find the current age. Use the cache's calculated age if supplied. Otherwise apparent_age = max(0, response_time − Date); corrected_age_value = Age + (response_time − request_time), with Age 0 if absent; corrected_initial_age is the larger of the two; current_age = corrected_initial_age + (now − response_time).
6. Compare: the response is fresh only while the lifetime is greater than the current age; equal or less is stale. Remaining time is lifetime minus age, never below zero.
7. Resolve conflicts as RFC 9111 says: honour the most restrictive directive, and for duplicate lifetime values either use the first or treat the response as stale, reporting undetermined if those differ and the cache's behaviour is unknown. Without an explicit lifetime, report undetermined rather than guessing a heuristic. Name any request directive (max-age, max-stale, min-fresh) or extension such as stale-while-revalidate that was not applied.

## Checks before you deliver

- no-cache permits storage with revalidation. Treating it as no-store misdiagnoses a normal conditional request.
- An unqualified private directive applies to shared storage. Do not apply it as a blanket ban on a browser cache.
- Using Expires when max-age is present gives the wrong lifetime. A recipient must ignore Expires whenever max-age is present.
- The Age header alone is not the current age. Add the delay in transit and the time the response has been stored.
- Treating an age equal to the lifetime as fresh. A response is fresh only while its lifetime is greater than its age.
- must-revalidate does not stop reuse while the response is fresh. It forbids serving it stale once the lifetime has passed, even when the origin cannot be reached.

## How to present the result

Lead with the decision for the named cache: fresh with N seconds left, stale, validate, do not store or undetermined. Then show the working in a few lines: which directive set the lifetime, how the age was calculated and the comparison. Finish with what will happen on the next request and, if that is not what was intended, the Cache-Control value that would achieve it.

## Worked example

**Request:** Assess a cacheable GET in a shared cache. No request modifiers or stale extensions.

**Supplied material:**

```text
Cache-Control: public, max-age=600, s-maxage=60
Calculated current age: 60 seconds
```

**Answer:** The CDN’s copy is stale. Its shared-cache lifetime is 60 seconds and its current age is exactly 60 seconds, leaving no fresh time. Validate it or fetch a fresh response before ordinary reuse.

## Structured output for tests

For an ordinary job, answer in the format above and point back to the supplied evidence. Use this structure only for the test cases published with this skill, or when someone asks for structured JSON.

Return decision as do-not-store, validate, fresh, stale or undetermined. Return lifetime_seconds and remaining_seconds as integers where the applicable explicit lifetime can be used, otherwise null. For validate and do-not-store use null for both. Clamp a stale remaining lifetime to zero.

## Sources

- [RFC 9111, HTTP caching](https://www.rfc-editor.org/rfc/rfc9111.html): The HTTP caching standard. Section 4.2.1 gives the lifetime order (s-maxage in shared caches, max-age, then Expires minus Date) and the rules for duplicates and conflicts; Section 4.2.3 gives the age calculation; Section 5 defines no-store, no-cache, private, must-revalidate and the rule to ignore Expires when max-age is present.
- [MDN Cache-Control reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cache-Control): Explains each directive in practical terms, including that private caches ignore s-maxage, that s-maxage overrides max-age and Expires in shared caches, and that no-cache allows storage but needs validation before each reuse.
- [MDN HTTP caching guide](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching): Describes private and shared caches, heuristic caching when no lifetime is given, and notes that no-cache does not guarantee revalidation for history navigations such as the Back button, which is why those cases are outside this check.

Test cases and an answer checker for this skill: https://skills.raq.com/skills/interpret-http-cache-freshness
