Tags: #system #contract #architecture #design #interface #SLA #fastly #cdn
Cache-Control: used if provided, otherwise default will be set.Surrogate-Control: augmented if provided, otherwise default will be set.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.
If no Cache-Control nor Surrogate-Control is provided, Perimeter will use the following default caching/stale directives:
Cache-Control: no-storeSurrogate-Control: max-age=%d, stale-while-revalidate=%d, stale-if-error=%dNote:
%dis a placeholder for the actual value set in Perimeter’sconfig.yml
There are a few exceptions to the defaults defined above:
max-age (it uses the stale-if-error value).smoke_path in config.yml) disables all caching.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.
The CDN will only cache the following status code responses:
200 OK203 Non-Authoritative Information300 Multiple Choices301 Moved Permanently302 Moved Temporarily404 Not Found410 Gone