Files cached by cloudflare


#24

You could limit the upload size on your website to limit file size, but CF has its own file size cache limit:


#25

There is no max size you can decide, at least Cloudflare side, they allow max 512MB, all bigger sizes are simply passed through.

If you want to limit file size you can do so at the origin using cache-control headers.


#26

Can I increase the 512MB to a size that I want? As 2GB?

How do I have to edit the page rules to do it?

Thanks


#27

There isnā€™t a way to do that apart from buying the Enterprise planā€¦ The limit is 512MB for everyone!


#28

And how can I decide to cache only mp4, mkv, zip and rar file extensions in the rule I attached in 17th post?

Thanks


#29

You need to simply put the file extension at the end, but I sincerely donā€™t know (would love to know) if there is a way to do so in a single page rule or if you need to create 4 of them.

The alternative way would be to issue the correct cache-control headers from the origin and make Cloudflare respect those.


#30

Can I set those three page rule settings in 17th post as http response headers from my origin?

Thanks


#31

Cache level no, you must set a page rule, but the others of course. They are basic Cache-Control headers.


#32

So can I set only Cache level = Cache everything in page rule, and from my origin can I set browser cache ttl and edge cache ttl response header to instruct cloudflare what has it to do?

Thanks


#33

Yes, they are not called like that, check the page and there is all the info you need to best configure your origin. You should look specifically to max-age and s-maxage, but itā€™s not limited to that.


#34

Can I instruct my origin to give two ā€œCache controlā€ response headers?

I thought (in my origin):
Cache-Control: max-age=86400
Cache-Control: s-maxage=2592000

And in page rule:
Cache level: cache everything

So in case of dynamic php page my origin can give a cache-control with 10 seconds, in case of a media (video, music, image) my origin can give 1 month of time catching.

Is it possible to do this?

Thanks


#35

I know nothing about PHP, the only thing I can tell you is that you should combine all Cache-Control headers in a single Header just like they do in the link I posted.

What you are saying is possible, I am sure. Donā€™t know how to implement in though in your origin.


#36

See the docs on cache-control

If you want to specify multiple, you can separate them with a comma space

Cache-Control: public, max-age=86400, s-maxage=2592000

#37

If I do so:

static files - my origin
Cache-Control: public, max-age=86400, s-maxage=2592000

dynamic files - my origin
Cache-Control: public, max-age=1, s-maxage=2

page rule
Cache level: cache everything

I can cache on cloudflare only static files? It will work?

Thanks


#38

Nobody?