How to invalidate Stale Page Cache on demand?

Hello,

Is there any way to invalidate Stale Page Cache on demand?

Is there a way to evict specific entries from the Stale Page Cache?

How about other types of cache (First Level and Enterprise)?

I’m thinking of a scenario where:

  • a long time to live is configured for cached items (we need it to be long or even “eternal”),
  • a change to the rendering logic is deployed; e.g. a template and CSS stylesheets are radically re-designed,
  • renderings stored in the long-lived cache before the deployment reference CSS classes that are no longer available; thus, when served, they look badly broken.

Ability to invalidate the cache or evict specific entries on request would prevent the broken rendering to be displayed.

Being able to get access to the stalePageCache from code to invoke some “purge” method on its API would be good enough. A secret URL or an admin option in CMS UI would be even better :grin:

Rafał