« Back to Index

[Example System Contract for Caching Behaviours]

View original Gist on GitHub

Tags: #system #contract #architecture #design #interface #SLA #fastly #cdn

Example System Contract for Caching Behaviours.md

Caching

Augmentation

Perimeter will augment the provided Surrogate-Control by appending stale-while-revalidate and stale-if-error directives if they are not defined.

See also “Extensions” section below.

Defaults

If no Cache-Control nor Surrogate-Control is provided, Perimeter will use the following default caching/stale directives:

Note: %d is a placeholder for the actual value set in Perimeter’s config.yml

Exceptions

There are a few exceptions to the defaults defined above:

Extensions

Both Cache-Control and Surrogate-Control have additional directives related to serving stale content, which are not part of the core HTTP caching standards document. These are stale-while-revalidate and stale-if-error.

Fastly CDN supports both of these extension directives via Surrogate-Control, but client compatibility (i.e. web browser support) via Cache-Control is less consistent.

Perimeter will only augment Surrogate-Control, it will not augment Cache-Control.

Status Codes

The CDN will only cache the following status code responses: