Is possible configure the cache-control header by page?
Community guidelines
Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.
Nope, please add a feature request here: https://github.com/getgrav/grav/issues
@rhuk what about this?
https://learn.getgrav.org/content/headers#cache-enable
Cache Enable
cache_enable: false
By default, Grav will cache the contents of the page file to ensure things run as fast as possible. There are advanced scenarios where you do not want the page to be cached.An example of this is when you are using dynamic Twig variables in your content. The
cache_enablevariable allows this behavior to be overridden. We will cover Twig Content variables in a later chapter. Valid values aretrueorfalse.
I think @jrivero is referring to HTTP headers :upside_down_face:
May be :) But I was looking for a way to disable cache on a single page myself today, so I'm sharing what I've found :)
Yes, my understanding was he was looking for the cache-control header option to be set by page. That option is an internal grav cache enable/disable by page.
Yes, I need define the time (max-age), and if cacheable (public, private, etc.) on each page type for the browser and varnish. I have some pages that change a lot and is interesting have a cache of 1 hour and other that change little a cache of 1 day.
This has been added and works in conjunction with expires: https://github.com/getgrav/grav/commit/13341c323d43eb47562d8ae72eae730e3e0e2cee
Log in to reply.
Suggested topics
| Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| 2 | 82 | 12 hours ago | ||
| 1 | 55 | 16 hours ago | ||
| 0 | 45 | 1 day ago | ||
| 6 | 348 | 5 days ago | ||
| 3 | 43 | 5 days ago |