Debug HTTP caching with browser and curl

8 steps · about 2 h 45 min · Intermediate

  1. Map the HTTP caching model (guide, MDN Web Docs, 30 min)

    Relate private and shared stores, freshness, validation and invalidation before changing headers.

  2. Read cache directives exactly (reference, MDN Web Docs, 28 min)

    Distinguish request and response meanings for freshness, storage and revalidation.

  3. Measure time spent in a shared cache (reference, MDN Web Docs, 15 min)

    Use the apparent resident age as evidence instead of assuming every response came from origin.

  4. Trace entity-tag validation (reference, MDN Web Docs, 18 min)

    Connect a representation validator to conditional requests and 304 responses.

  5. Compare time-based validation (reference, MDN Web Docs, 16 min)

    Recognize the precision and clock limits of a modification-time validator.

  6. Audit cache-key variation (reference, MDN Web Docs, 18 min)

    Check whether language, encoding or another request header creates separate stored variants.

  7. Reproduce validation requests (guide, MDN Web Docs, 20 min)

    Build If-None-Match and If-Modified-Since requests that distinguish validation from a full transfer.

  8. Inspect shared-cache decisions (reference, IETF, 20 min)

    Use structured Cache-Status details to confirm hits, forwards and stored responses across intermediaries.