Page Rules With img type?

Not sure the answers to this
But I wanna have page rules for my photos because they are not in one folder.

So the rule I am trying is
mydomain.com/.jpg so Asterisk then dot and file type/ or Asterisk no dot and file type
mydomain.com/
.png
Is that ok or should it be without the Dot
/*jpg

On my server the setup of folders are /_files/folders/gallery
plus
_files/folders/img
_files/folders/photos
/template/templatename/gallery
template/m/templatename/gallery
And so many more

So can anyone offer the best way to do the page rules without listing every folder?

Usually, Cloudflare should cache static files like images, css, javascript, etc. for the whole domain.

  • using the cache level with value of “Standard”

At your hosts/origin you can setup cache-control headers and more. Moreover, even at Cloudflare dashboard this is possible.

You actually do not need any page rule for the assets under the folders:

_files/folders/img
_files/folders/photos
/template/templatename/gallery
template/m/templatename/gallery

In case you want you can try to add a Page rule should look like this for example:

URL: yourdomain.com/folder/images/*
Cache Level: Cache Everything
etc.

Cloudflare will cache by default static files, you can check all file types that are cached here:

https://www.cloudflare.com/learning/cdn/caching-static-and-dynamic-content/

Thanks for your reply.

There are many folders with images in them. some for the site itself. some for members to upload their photos. some for the templates and mobile app . and some for icons

So I did not want to have the same cache for one fits all. plus I cannot use cache everything where there are photos and html files in the same folders

I would just like to show a screenshot that shows that Cloudflare clearly does not cache all the files as it should

Hit And miss

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