Menu

Where max-age stops in Drupal
📰

Where max-age stops in Drupal

Drupal.org aggregator·4 days ago
#293djADn
#planetdrupal#mglaman#theme#items#cache
Long article (1464 words) — no AI summary yet.
Reading 0:00
15s threshold

Dynamic Page Cache respects max-age. Internal Page Cache and the Cache-Control header your CDN reads don't. Here's how to keep Dynamic Page Cache working and give pages a real lifetime.

Did you know max-age doesn't make it out of Drupal?

A page's max-age usually isn't set on purpose. An access check returns a result marked uncacheable. A block's getCacheMaxAge() returns 0 . A view uses time-based caching set to one hour. Each of those bubbles up and lowers the max-age of the whole response.

Dynamic Page Cache respects that. Then it stops. Internal Page Cache ignores it, and so does the Cache-Control header your CDN or reverse proxy reads. Every cacheable page leaves Drupal with the same lifetime, whatever its content declared.

Know which caches ignore it

A response can be cached in three places after Drupal builds it. Only one of them respects max-age .

Dynamic Page Cache caches the page for every user, with personalized parts left as placeholders. It respects max-age .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.