Cache by file extension and CF-Cache-Status: DYNAMIC

On this page: https://support.cloudflare.com/hc/en-us/articles/200172516 it is stated that

Cloudflare only caches based on file extension and doesn’t cache by MIME type. The Cloudflare CDN automatically caches files containing certain file extensions and doesn’t cache HTML by default

and then lists some file extensions which i get. The documentation then moves on to describe the different types of CF-Cache-Status’. For CF-Cache-Status: DYNAMIC header, it states that

The resource content type was not cached by default and your current Cloudflare caching configuration doesn’t instruct Cloudflare to cache the resource. Instead, the resource was requested from the origin web server. Use Page Rules to implement custom caching options.

I read “resource content type” as MIME type which for me contradicts the first quote. Should the documentation for DYNAMIC be updated to state “file extension” instead of “resource content type”? Or am I missing something?

1 Like

It does look like a conflict. I haven’t tested for MIME type, but file extension (or lack of) seems to be the way it’s done.

Maybe @cloonan can chime in and/or forward this so the documentation can get cleaned up.

1 Like

If @cloonan could give some insights on this, it would be great!

1 Like

:wave: @mslot,

Caching is based on extension, not mime type. To implement a cache rule requires either cache everything on a path, in which case mime type is irrelephant :elephant: or a specific pattern (e.g. /*.xyz ) in which case the file extension match determines whether or not the object is cached.
— OG

1 Like

@OliverGrant, it is. That is why is an questioning the DYNAMIC documentation.

:wave: @mslot,

Sorry since you asked @cloonan to chime in I assumed there was some question as to the actual behavior.

— OG

1 Like

Thanks everyone, appreciate it. I’ve let the doc team know and they’re looking to clarify, will update as I hear more.

1 Like

This topic was automatically closed after 14 days. New replies are no longer allowed.