picocms / Pico

Pico is a stupidly simple, blazing fast, flat file CMS.
http://picocms.org/
MIT License
3.81k stars 616 forks source link

HTTP headers - why no cache, and why is the expiry date Thu, 19 Nov 1981 08:52:00 GMT? #628

Closed ohnonot closed 2 years ago

ohnonot commented 2 years ago

Hello, On researching a related subject, I found that HTTP headers generated by pico always include the following:

Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache

I already learned elsewhere that pico doesn't use cache by default, but I wonder what the reasoning is or what would happen if I managed to change that? I could find no documentation or code that would explain how these are generated (it does not happen with other html or php content outside of pico)?

And why always Thu, 19 Nov 1981 08:52:00 GMT?

PhrozenByte commented 2 years ago

I already learned elsewhere that pico doesn't use cache by default,

This was about server-side caching. Here you're talking about client-side caching (i.e. browser caching). Even though both are some kind of caching, they are not related.

Pico sets no HTTP caching headers. Caching is totally up to your webserver. These headers are added by your webserver, not Pico; so you'll have to check your webserver config.

ohnonot commented 2 years ago

It's a plugin doing that: https://github.com/nliautaud/p01contact I'm working on a fork right now that will enable it only on chosen pages.