close

Filter

loading table of contents...

Headless Server Developer Manual / Version 2404

Table Of Contents

3.3.4 HTTP Cache-Control

HTTP Caching improves the website performance by instructing CDNs and clients to reuse previously fetched resources. The Cache-Control HTTP header offers fine-grained instructions for CDNs and HTTP clients on how to cache. With the CoreMedia Cache Control API and default implementation, projects have full control over caching behavior of content delivered by CoreMedia Content Cloud.

HTTP Cache-Control headers can be configured for GET requests by URL pattern. The configuration options are those defined by Cachecontrol. The most important property in this context is the max-age property.

The value of the Cache-Control header's max-age directive is the minimum of the values of the validFrom/validTo properties of the requested contents and the configured max-age value for the given request URL. If no cache control configuration exists and the content does not contain a value for its validFrom/validTo then no Cache-Control header is sent. A negative max-age value indicates that no Cache-Control header should be sent even in the presence of configured validFrom/validTo dates.

# articles should be cached for at most four hours
caas.cache-control.for-url-pattern[/caas/v1/article/**].max-age = 4h
# disable cache control headers for raw content requests
caas.cache-control.for-url-pattern[/caas/v1/content/**].max-age = -1

Example 3.1. Example Cache-Control Configuration


See Section 3.3.5, “Headless Server Cache Control Properties” in Deployment Manual for all configuration options.

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.