Resources · 99

Shared caching: test privacy, variants and invalidation

Speed up public responses while preventing cross-account reuse and checking how outdated versions are removed.

· 4 min

Laptop displaying code on a desk Illustration · fictional scene

What this guide helps achieve

  • Classify responses
  • Inspect effective rules
  • Test separation between users
  • Exercise version correction
  • Retain change controls

Quick check

  • Does no-cache mean no storage?
  • Does a cookie prevent shared caching?
  • Is hit rate sufficient?

Step-by-step method

  1. 01

    Classify responses

    Inventory public pages, personalised responses, downloads and errors. For each class, record what may be retained, by which component and for how long. Identify responses varying by account, language or authorisation.

    Deliverable: response and variation inventory.

  2. 02

    Inspect effective rules

    Inspect the response after the proxy, not only application configuration. no-cache requires revalidation before reuse; no-store prohibits storage. private restricts storage to private caches. Record CDN rules that can modify headers.

    Deliverable: captured headers for each journey.

  3. 03

    Test separation between users

    With authorised test accounts, request the same URL under two identities and then without a session. Use distinct fictional markers. Check bodies, downloads and conditional responses. Repeat with cold and warm caches without including real personal data in evidence.

    Deliverable: reproducible cross-account separation test.

  4. 04

    Exercise version correction

    Publish a test change, then check origin, proxy and browser. Measure time until the correct version appears and exercise the planned purge. For versioned assets, verify that HTML references the new filename or identifier.

    Deliverable: propagation timeline and purge procedure.

  5. 05

    Retain change controls

    Replay scenarios after cache, sign-in or language changes. Track incorrect responses and removal capability alongside hit rate. Assign an owner for the control and urgent invalidation.

    Deliverable: regression tests and named owner.

Decide where a response may be reused

Follow the actual returned content, then validate privacy and removal separately.

  1. Personal response

    Prevent cross-account reuse and inspect the received result.

  2. Varying public response

    Document necessary variations and compare the corresponding responses.

  3. Corrected version

    Exercise purge and check the new version across cache layers.

Illustrative case: a public catalogue may be shared while account details must remain separate. Cache speed does not validate that separation.

Four situations for exercising cache policy

Illustrative scenarios to replay with authorised test accounts and content. They are not customer incidents or measured performance results.

SituationCheck to performDecision and expected evidence
Account page followed by the same URL without a sessionUse two fictional identities and then an anonymous visit; compare content and headers after the proxy with cold and warm caches.Any marker from another account blocks reuse; retain configuration and denial evidence without personal data.
Two languages at one addressCompare received variants and the language selection mechanism; check the actual cache key and Vary fields.The variant must match the request; correct the key or separate addresses, then replay both visit orders.
Public document corrected at the originCheck the version received from origin, shared cache and browser; record what the purge actually covers.A CDN purge does not prove deletion of an already saved copy; document propagation and copies outside your control.
Conditional response after an identity changeReplay a request with a validator in a controlled environment and inspect the representation actually reused.A 304 alone does not prove separation; examine the associated representation and permissions.

Reusable worksheet

Complete with your authorised observations. These fields are a working template, not observed results.

FieldInformation to record
Response classPublic, personal, download or error
VariationAccount, language, authorisation and relevant parameters
Removal testChange, cache layers, result and delay
AcceptanceResult by scenario, retained evidence and blocking discrepancy

Worked example

Illustrative situation

Fictional example: an account page displays the marker ACCOUNT-A. A second identity and an anonymous visit then request the same URL after the cache has been populated.

Decision and expected evidence

If the marker appears elsewhere, stop shared reuse of that response, correct the rules and replay both visit orders. Also check the conditional response and retain evidence without personal data.

Distinguish the mechanisms

MechanismPurposeCheck or limitation
Browser cacheReuse by one userTest sign-out and history separately
Shared cacheReuse across usersExclude personal responses
Versioned assetRetain an identified versionUpdate references and preserve consistency

Management indicators

IndicatorWhat it measuresFirst action
SeparationCross-account scenarios without mixingBlock every discrepancy
PropagationObserved delay until the correct versionReview rules and purge

Common pitfalls

  • Test sign-out and history separately
  • Exclude personal responses
  • Update references and preserve consistency

Frequently asked questions

Does no-cache mean no storage?

No. It requires validation before reuse. no-store concerns prohibiting storage. Check proxy rules as well.

Does a cookie prevent shared caching?

Do not assume it. Verify effective rules and responses using two test accounts.

Is hit rate sufficient?

No. A quickly reused response can be incorrect or personal. Check content, variants and invalidation.

Official references

References consulted: . The method and worksheet propose checks to adapt to your context; they do not constitute certification.