Disable caching of mp4 files

Hi. How to create a rule correctly so that mp4 files are not processed using cloudflare servers? I need to use Cloudflare proxying for the domain, but exclude mp4 processing. Thank you.

Welcome to the Cloudflare Community. :logodrop:

Your best option will be to host the mp4 files on a subdomain that is set to :grey: DNS Only.

Is there another option?

You could use an entirely different domain that wasn’t on Cloudflare at all.

Your criteria of the files not being processed using Cloudflare servers limits your options. It may depend on what you mean by processed, but I interpreted it in a broad manner meaning that you did not want the mp4s to touch the Cloudflare network.

thanks for your reply. Can I use the rules to exclude caching of mp4 files or not?

You could always test with a cache rule to match (ends_with(http.request.uri.path, ".mp4")) and bypass cache.

Thank you. But unfortunately the rule does not work, as before, a video from Cloudflare is launched instead of my file.

This is the first you mentioned that. You will will definitely need to either

or possibly host them on Cloudflare R2 storage.

1 Like

That is, there is no way to disable caching of mp4 files on the cloudflare side?

Cloudflare doesn’t cache MP4 files by default. But if a hostname is proxied all traffic to the hostname is proxied. It’s how the interwebs work. Hence the suggestion to use a different hostname or switch to DNS only.

I would have thought the same, but MP4 appears on the list of default cached file extensions.

That doesn’t eliminate the need to change how the files are served in this case. A Cloudflare video appearing in place of the original content indicates that there is a ToS issue. The only options that will fix that can be found in the following documentation.

Hrm… I wonder if that’s a change re: Stream or if I’ve just gotten old(er) and my memory is… oh look a :butterfly:

1 Like

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