My issue appears to be identical to this one posted a few months ago: Cache-Control header not working. Why is Firefox revalidating everything?
I’ve configured my backblaze bucket to provide the following header:
{"cache-control":"public, s-maxage=31536000, max-age=86400"}
And when I fetch directly from BackBlaze I see these headers as expected:
Response
HTTP/1.1 200
Content-Type: image/webp
Keep-Alive: timeout=5
Date: Fri, 06 Aug 2021 21:30:29 GMT
Content-Length: 4266
Cache-Control: public, s-maxage=31536000, max-age=86400
Connection: keep-alive
Accept-Ranges: bytes
ETag: "5f45aff8c7a722ae2499854fb1d98db2"
Last-Modified: Fri, 06 Aug 2021 17:30:49 GMT
x-amz-id-2: aNdY55mN7NNsziDhRMfQ26DdwNdQ3kDjX
x-amz-version-id: 4_zf5e97cd4c3f8f13677a50718_f118f2bf198a8ee9c_d20210806_m173049_c002_v0001152_t0001
x-amz-request-id: 966866aca2cf93e3
x-amz-meta-src_last_modified_millis: 1628128073945
Now, when I first hit Cloudflare there’s a MISS. Fine.
Then, when I hit it again there’s a HIT:
< HTTP/2 200
< date: Fri, 06 Aug 2021 23:36:59 GMT
< content-type: image/webp
< content-length: 4266
< cf-ray: 67ac172aee9ef172-PIT
< accept-ranges: bytes
< age: 10
< cache-control: public, max-age=86400, s-maxage=31536000
< etag: "5f45aff8c7a722ae2499854fb1d98db2"
< last-modified: Fri, 06 Aug 2021 17:30:49 GMT
< cf-cache-status: HIT
< expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
< x-amz-id-2: aNeU5fWMLNFQzLjj7MRs2lDccNWo3ojhB
< x-amz-meta-src_last_modified_millis: 1628128073945
< x-amz-request-id: 6f70dc2335d3e997
< x-amz-version-id: 4_zf5e97cd4c3f8f13677a50718_f118f2bf198a8ee9c_d20210806_m173049_c002_v0001152_t0001
< report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=GDtvV5KHi31yOZP%2BPK4q1Ynb7BPT5pPhsEPZcIWOwJ1j23UTJtKQVgxzNSoNlFUvtXBJPbmg19HOaKR2NbN4dpxIHeqMZCV89ih1G0XcGn1UWWtujc5LxKSqtjMr9aSlyg51Lhs%2B8mY%3D"}],"group":"cf-nel","max_age":604800}
< nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
< server: cloudflare
< alt-svc: h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; ma=86400
<
Not the 'age:10
. The highest that’ll go is 59 before I get back anotehr REVALIDATED, like so:
< HTTP/2 200
< date: Fri, 06 Aug 2021 23:38:19 GMT
< content-type: image/webp
< content-length: 4266
< cf-ray: 67ac191f0f7cf186-PIT
< accept-ranges: bytes
< cache-control: public, max-age=86400, s-maxage=31536000
< etag: "5f45aff8c7a722ae2499854fb1d98db2"
< last-modified: Fri, 06 Aug 2021 17:30:49 GMT
< cf-cache-status: REVALIDATED
< expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
< x-amz-id-2: aNeU5fWMLNFQzLjj7MRs2lDccNWo3ojhB
< x-amz-meta-src_last_modified_millis: 1628128073945
< x-amz-request-id: 6f70dc2335d3e997
< x-amz-version-id: 4_zf5e97cd4c3f8f13677a50718_f118f2bf198a8ee9c_d20210806_m173049_c002_v0001152_t0001
< report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=QcpGTqO5wswDXb6rQIjZ9r0LqDLxUjWXaFUY4DfKPQMkhjG34H6933RTycMgU%2FC8w4BIgxROjbAbuDqcT6EKfxiQA7jGrkRaCfb3TJVVfkVmCk3t1rzFc5DmKdZBsCoTO%2Fd2%2BGi23%2Bc%3D"}],"group":"cf-nel","max_age":604800}
< nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
< server: cloudflare
< alt-svc: h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; ma=86400
<
I have also configured a page rule to try and rule this to no avail – it seems to do nothing:
What am I missing?