A question about * usage in Page Rules

Feel very confused for the Page Rues wildcard usage

If I want to cache files of:

  • www.domain.com/folder1/files/audio.mp3
  • www.domain.com/folder2/files/pic.png
  • www.domain.com/folder3/files/example.html

Can I just use one rule as follows?

www.domain.com/*/files/

correct would be:

www.domain.com/*/files/*

(with the trailing *)

even better would be:

www.domain.com/folder*/files/*

Thanks for such fast reply.

Is there a way I could test whether the rules are working?

Yes ofc. But your rules to “cache” it are unnessasary as static files like these are automatically getting cached.

But just clear the cache for these files and call them, inspect the header and see if it shows:

cf-cache-status: HIT
or
cf-cache-status: MISS

Thanks for the fast reply!

How do CF determine a request is a static file request?

By the extension in the URL?

Pls have a read here: LINK

Its done by the URL Extension.

Means if you provide a file:
https://sub.domaion.tld/image.jpg (which is a renamed .webp file)

this anyway will get handeled as .jpg
Also CloudFlare does ignore the mimetype.
CloudFlare is Nginx based and works on URL base.

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