Mobile app version of vmapp.org
Login or Join
Gail5422790

: Does CloudFlare cache videos, and would this wildcard Page Rule work for that? I'm setting everything up in my website to use CloudFlare. This is my example: On videos.domain.com/Folder-A/Folder-B/

@Gail5422790

Posted in: #Cache #Cdn #Cloudflare #Video

I'm setting everything up in my website to use CloudFlare.

This is my example:

On videos.domain.com/Folder-A/Folder-B/ there are some HTML files that I would NOT like CloudFlare to cache. But inside those folders, there is another one called videos, like: videos.domain.com/Folder-A/Folder-B/videos

I would like CloudFlare to cache the content in this last example URL, but not in the first one. Please note that Folder-A and Folder-B are examples and I have lots of different folders using this structure, so creating page rules one-by-one is not an option.

Here's what I've done so far using wildcards with Page Rules:

videos.domain.com/* --> Do not cache

videos.domain.com/*/videos/* --> Cache everything

Is this Ok? And also, does CloudFlare cache videos (mp4) if Cache everything is enabled?

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Gail5422790

3 Comments

Sorted by latest first Latest Oldest Best

 

@Shelley277

As I posted on StackOverflow...

Assuming your video content is simply a file downloaded over HTTP/HTTPS (and not streamed over some other protocol) then it appears that CloudFlare might actually support this.

I just tested an MP4 video file on a client's website and it appeared to be cached by CloudFlare correctly.

My CloudFlare settings page rule:



The request (which shows a cache hit):

10% popularity Vote Up Vote Down


 

@Bryan171

Cache everything actually would cache everything (should be used with care).

If you are, however, streaming content on your site the advise still stands from the earlier comment by dan.

10% popularity Vote Up Vote Down


 

@Nimeshi995

does CloudFlare cache videos (mp4) if Cache everything is enabled?


According to Damon at CloudFlare (see his answer below), everything is cached if Cache everything is enabled.

As indicated in the CloudFlare knowledge base article here, it's recommended to move video content to a subdomain so that it's not proxied by CloudFlare:


Sites that do streaming content, however, should move their streaming
content to a subdomain we don't proxy in their DNS settings. If you
created a subdomain like streams.yourdomain.com, you could then add it
in your CloudFlare DNS settings like:

CNAME streams is an alias of domain.com (make sure cloud is grey).

We have seen sites have performance issues because of the number of
connections that streamed content causes when running through the
CloudFlare proxy.

Note: Embedded services - such as YouTube and Vimeo - would not
require any special configuration because that content is being served
off of your site.


Since you've already created a subdomain for your videos, you would only need to disable their proxy for that subdomain (i.e., make sure the cloud is grey), instead of setting a Page Rule.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme