CF-Cache-Status: DYNAMIC ... cloudflare in front of cloudflare?

Hello,

I’m looking to use CF to cache JSON, image, and mp4 assets from an upstream service provider that also appears to be using Cloudflare.

Initially I was seeing CF-Cache-Status: BYPASS, which I discovered it was due to the Set-Cookie header in the response. I added a rule for Cache on Cookie with the value .* and that got me to CF-Cache-Status: DYNAMIC. However, I’m not able to get HIT responses, which is what I’m looking for.

My biggest hunch is that this isn’t working because the upstream provider also happens to be using Cloudflare; might this be the case?

Otherwise, based on the output below, any suggestions on how to get CF to cache?

The page rules set on this site are:

Browser Integrity Check: Off, Security Level: Essentially Off, Cache Level: Cache Everything, Cache on Cookie: .*

Thank you.

$ https -p Hh https://example.com/assets/thing.jpg
GET /assets/DW-S1-B8J6P.jpg HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Host: example.com
User-Agent: HTTPie/3.2.1

HTTP/1.1 200 OK
Accept-Ranges: bytes
Access-Control-Allow-Headers: Content-Type, Range, User-Agent, X-Requested-With
Access-Control-Allow-Methods: GET, HEAD
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Content-Length, Content-Range, X-Chunked-Output, X-Ipfs-Path, X-Ipfs-Roots, X-Stream-Output
Age: 2750
CF-Cache-Status: DYNAMIC
CF-RAY: 73574776985b32f0-SJC
Cache-Control: public, max-age=29030400
Connection: keep-alive
Content-Length: 2068291
Content-Type: image/jpeg
Date: Thu, 04 Aug 2022 12:26:03 GMT
ETag: "QmUDmux3ZM8PXQE9YKeAG6Qs9wYE2bRWAGz4ZaoDqC7TCU"
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Expires: Thu, 06 Jul 2023 12:26:03 GMT
Server: cloudflare
Set-Cookie: _cfuvid=XXXXXXXX-1659615963286-0-604800000; path=/; domain=.example.com; HttpOnly; Secure; SameSite=None
Vary: Accept-Encoding
psr: true

Hello Community,

I’m still trying to resolve this; any ideas?

Thank you.

CC: Cloudflare

Just to add a note, may I ask how large (filesize) are they? :thinking:
Might want to watch out to not violate the ToS, otherwise use Cloudflare Stream.

@fritex thanks for pointing this out. Can you point me to the ToS page that describes file size limits.

This aside, if the response is DYNAMIC, it’s not being cached anyway. Of all the files coming from upstream, .mp4 files are a small number; the vast majority are JSON files that are 1k in size.

Any idea how to get CF to cache these files?

In such case if you receive some e-mail, however consider reading below posts:

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.