Skip to content

Instantly share code, notes, and snippets.

@xzyfer
Created February 26, 2016 00:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xzyfer/8b872f2b15a8ba990c4d to your computer and use it in GitHub Desktop.
Save xzyfer/8b872f2b15a8ba990c4d to your computer and use it in GitHub Desktop.
Surrogate Keys Recommendation

Surrogate Keys

The fastly article on the topic does a great job of explaining what surrogate keys are. I suggest familiarising yourself with it before continuing.

TLDR; the Surrogate Keys response header is a space delimited list of "tags" for that given response.

Why

Using surrogate keys we can more precisicely purge specific sets of reponses from the fastly cache. For exmaple we could choose to purge all CMS template, or CMS resource centre templates, or simply all CMS pages with a single column upsell element.

Potential keys

I've compiled a short list of keys that in combination could provide the desired level of automate cache purging granularity.

  • language
  • static archtype (home, visual brief, social sharing)
  • cms archtype (product, promo, resource centre ...)
  • cms cells/elements

Some of these are easier than others to achieve.

An example response could look like Surrogate Keys: de cms/archtype/product cms/element/faq cms/element/...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment