Which configuration must be applied to enable re-fetching of cached items based on Cache Headers sent by AEM ?
/enableTTL true
/enableTTL "1"
Thanks
Solved! Go to Solution.
Views
Replies
Total Likes
Hello @JakeCham
Please use
/enableTTL "1"
- Ensure the Cache-Control: max-age=60
header. max-age can be any value
- Next set /enableTTL "1"
- You will need to restart Apache for this change to take effect:
sudo apachectl restart
There is an excellent repository of dispatcher experients. Do check this one https://github.com/adobe/aem-dispatcher-experiments/tree/main/experiments/enableTTL
Hi @JakeCham
You can use /enableTTL "1"
try below steps
/cache {
## The cacheroot must be equal to the document root of the webserver
/docroot "${PUBLISH_DOCROOT}"
## sets the level upto which files named ".stat" will be created in the
## document root of the webserver. when an activation request for some
## handle is received, only files within the same subtree are affected
## by the invalidation.
#/statfileslevel "1"
## caches also authorized data
/allowAuthorized "1"
## Flag indicating whether the dispatcher should serve stale content if
## no remote server is available.
#/serveStaleOnError "0"
## the rules define, which pages should be cached. please note that
## - only GET requests are cached
## - only requests with an extension are cached
## - only requests without query parameters ( ? ) are cached
## - only unauthorized pages are cached unless allowUnauthorized is set to 1
/rules {
$include "/etc/httpd/conf.dispatcher.d/cache/* "
# the invalidate section defines those pages which are 'invalidated' after
# any activation. please note that, the activated page itself and all
# related documents are flushed on an modification. for example: if the
# page /foo/bar is activated, all /foo/bar.* files are removed from the
# cache.
/invalidate {
/0000 {
/glob "*"
/type "deny"
}
/0001 {
/glob "*.html"
/type "allow"
}
/0002 {
/glob "/etc/segmentation.segment.js"
/type "allow"
}
/0003 {
/glob "*/analytics.sitecatalyst.js"
/type "allow"
}
}
/allowedClients {
## By default block all IP from allowing to initiate the invalidation commands
/0000 {
/glob "*.*.*.*"
/type "deny"
}
## Allow certain IP's like publishers to invalidate cache
$include "/etc/httpd/conf.dispatcher.d/cache/ams_publish_invalidate_allowed.any"
}
## The ignoreUrlParams section contains query string parameter names that
## should be ignored when determining whether some request's output can be
## cached or delivered from cache.
## In this example configuration, the "q" parameter will be ignored.
#/ignoreUrlParams {
# /0001 { /glob "*" /type "deny" }
# /0002 { /glob "q" /type "allow" }
#}
## Cache response headers next to a cached file. On the first request to
## an uncached resource, all headers matching one of the values found here
## are stored in a separate file, next to the cache file. On subsequent
## requests to the cached resource, the stored headers are added to the
## response.
## Note, that file globbing characters are not allowed here.
/headers {
"Cache-Control"
"Content-Disposition"
"Content-Type"
"Expires"
"Last-Modified"
"X-Content-Type-Options"
}
## A grace period defines the number of seconds a stale, auto-invalidated
## resource may still be served from the cache after the last activation
## occurring. Auto-invalidated resources are invalidated by any activation,
## when their path matches the /invalidate section above. This setting
## can be used in a setup, where a batch of activations would otherwise
## repeatedly invalidate the entire cache.
#/gracePeriod "2"
## Enable TTL evaluates the response headers from the backend, and if they
## contain a Cache-Control max-age or Expires date, an auxiliary, empty file
## next to the cache file is created, with modification time equal to the
## expiry date. When the cache file is requested past the modification time
## it is automatically re-requested from the backend.
# /enableTTL "1"
}
Hello @JakeCham
Please use
/enableTTL "1"
- Ensure the Cache-Control: max-age=60
header. max-age can be any value
- Next set /enableTTL "1"
- You will need to restart Apache for this change to take effect:
sudo apachectl restart
There is an excellent repository of dispatcher experients. Do check this one https://github.com/adobe/aem-dispatcher-experiments/tree/main/experiments/enableTTL
Views
Likes
Replies
Views
Likes
Replies