documentation icon indicating copy to clipboard operation
documentation copied to clipboard

Experience protection does not cache static assets in non-live environments

Open kirrrk opened this issue 1 year ago • 1 comments

source/content/guides/global-cdn/02-experience-protection.md https://docs.pantheon.io/guides/global-cdn/experience-protection

Expected behavior

  • Some customers have expected experience protection to work in non-live environments and have attempted to test it by setting the environments to maintenance mode.

Actual behavior

  • The platform sets a no-cache and revalidate cache-control headers on static assets in non-live environments. This prevents static assets from being cached, so experience protection does not work as expected (pages will not render properly).

Suggested Resolution

  • Add a note to the experience protection documentation clarifying that static assets are not cached in non-live environments. Experience protection can only return cacheable data and is only intended to protect live environments.
  • There is a note in our Advanced Caching Topics document that can be used as a reference: https://docs.pantheon.io/caching-advanced-topics#manually-expiring-cache-for-static-assets

Dev and Multidev environments always set an HTTP header to cache-control: no-cache, must-revalidate so that changes to CSS and other assets are always reloaded as developers update them.

Additional information

  • https://pantheon.slack.com/archives/C0ACN422E/p1725559984497519
  • https://pantheon.slack.com/archives/C06J7Q565FC/p1723753325347359

kirrrk avatar Sep 05 '24 18:09 kirrrk

@rachelwhitton, if you need more info, please book co-working time with an SME to write the PR together.

stevector avatar Sep 05 '24 19:09 stevector