[opencms-dev] Configuration of max-age-Header in OpenCms possible?

Schliemann, Kai K.Schliemann at comundus.com
Tue Mar 16 08:32:10 CET 2021


Hein,

thanks a lot for your answer. I am aware of that option, but I was curious, if there is a setting in OpenCms.
And there is one. See https://documentation.opencms.org/opencms-documentation/caching-in-opencms/static-export/index.html#3.1.4.
One can set exportheaders in opencms-importexport.xml like this:

                  <exportheaders>
                                 <header>cache-control:mag-age=2629743830</header><!-- one month -->
                </exportheaders>

Best regards
Kai


Von: opencms-dev <opencms-dev-bounces at opencms.org> Im Auftrag von Hein van der Kallen
Gesendet: Donnerstag, 11. März 2021 12:00
An: 'The OpenCms mailing list' <opencms-dev at opencms.org>
Betreff: Re: [opencms-dev] Configuration of max-age-Header in OpenCms possible?

Kai
If you use Apache you can set DateExpiresHeaders like in
https://gtmetrix.com/serve-static-assets-with-an-efficient-cache-policy.html
or somewhere included in your httpd.conf.

Hein van der Kallen

Van: opencms-dev <opencms-dev-bounces at opencms.org<mailto:opencms-dev-bounces at opencms.org>> Namens Schliemann, Kai
Verzonden: woensdag 10 maart 2021 09:39
Aan: The OpenCms mailing list <opencms-dev at opencms.org<mailto:opencms-dev at opencms.org>>
Onderwerp: [opencms-dev] Configuration of max-age-Header in OpenCms possible?

Hi list,

OpenCms seems to set the max-age header to 1 day per default.
For SEO reasons we want to change the value at least for static resources like images, css and js files.
Background info: https://web.dev/uses-long-cache-ttl/

There are several places In the source code where the DateExpiresHeader is set: https://github.com/alkacon/opencms-core/search?q=setDateExpiresHeader

I wonder, if there Is a possibility to change that setting in a config file?

Thanks for your help.

Best regards
Kai

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.opencms.org/pipermail/opencms-dev/attachments/20210316/209e3eb0/attachment.htm>


More information about the opencms-dev mailing list