On 3/3/21 10:48 AM, Per Jessen wrote:
Per Jessen wrote:
Bernhard M. Wiedemann wrote:
Header is there:
curl -I https://forums.opensuse.org/images/misc/arrow.png HTTP/1.1 200 OK Date: Wed, 03 Mar 2021 06:29:21 GMT Server: Apache/2.4.43 (Linux/SUSE) Strict-Transport-Security: max-age=31536000 X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1;mode=block X-Content-Type-Options: nosniff Last-Modified: Mon, 10 Nov 2014 15:14:41 GMT ETag: "74-507829f299a40" Accept-Ranges: bytes Content-Length: 116 Cache-Control: max-age=604800 Expires: Wed, 10 Mar 2021 06:29:21 GMT Vary: User-Agent Content-Type: image/png X-Forwarded-For: (null)
IIRC in absense of such headers, browsers had a caching heuristic using the ratio between Last-Modified and when they last checked, so you do not get any improvement.
That I was not aware of, but it matches what I am seeing :-)
I looked it up, it seems that most browsers, in the absense of any caching instructions, default to "10% of today-lastmod", but maximum 1 week. That certainly explains why I have not seen any major improvement sofar.
Bear in mind that a browser cache does not have infinite size or sometimes gets just cleared. So even choosing a longer cache TTL at the server side does not necessarily result in a higher cache rate. Also long caching TTLs can be pretty annoying for end users after upgrading the server software. Ciao, Michael.