close

Filter

loading table of contents...

Content Application Developer Manual / Version 2107

Table Of Contents

3.3.1 Object Type based Configuration

The object type based configuration allows you to configure default Cache-Control header by object type. The object type is the class of the model that is resolved by the handler mapping of the CAE. The configuration is type specific, but can also benefit from abstraction along the class hierarchy. That means that you may simply configure a common value for a super class instead of taking care about all the child classes. The type information part of the property name should be the simple name of the class (no package information, see Example 3.1, “Type based Cache-Control Configuration”) and in lowercase. Configuration of classes with the same name in different packages is not supported.

# Cache Control Configuration
cae.cache-control.for-type.cmlinkable.max-age=1m

# time to cache blobs: "forever", aka 180 days
cae.cache-control.for-type.blob.max-age=180d
cae.cache-control.initial-max-age-for-type.blob=180d

# Fallback if nothing else specified
cae.cache-control.initial-max-age-for-type.object=1m
cae.cache-control.for-type.object.max-age=1m

Example 3.1. Type based Cache-Control Configuration


If you want to omit that the Cache-Control Header is added for an object type, you can set cae.cache-control.for-type.myobject.max-age=-1s. Otherwise, the fallback configuration for cae.cache-control.for-type.object.max-age=1m would be used.

In case your request mapping resolves, for example, a combined object like an article page, consisting of a navigation and a main article, the lookup mechanism uses the type of the article first to produce a configuration match and then tries the type hierarchy of the page itself. This can be customized to project needs by defining a primary bean of type Function<Object, Stream<Type>>.

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

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