Cache Rules Not Working

I have set a cache rule for a file (/embed/script.js). My rule is:

(http.request.uri.path contains "/embed/script.js")

I have set the browser TTL to 2 hours. However, when I look at the file I see it has a browser TTL of 1 year. I’ve cleared the entire site cache as well as that individual file and it still won’t apply the proper cache setting.

There may be a couple of reasons why your cache rule is not being applied to the /embed/script.js file. Here are a few potential solutions:

  1. Make sure the cache rule is properly configured: Double-check that the rule you have created on the Cloudflare dashboard is properly formatted and that it matches the URL of the file you are trying to cache.
  2. Check for any conflicting rules: If you have multiple cache rules for the same file, there may be conflicting rules that are preventing the desired rule from being applied. To resolve this, you can try disabling or deleting any conflicting rules.
  3. Check for caching plugins or settings on your website: If you are using a caching plugin or have caching settings on your website, these may be overriding the cache rule you have set on the Cloudflare dashboard. Try disabling or adjusting these settings to see if it resolves the issue.
1 Like