My images have started to return the header cf-cache-status: DYNAMIC and are no longer being cached.
I’ve applied a few rule chances, but this was hours ago.
Here is a link that should be showing as a hit: https://www.infinitesweeps.com/static/i/p/187673/
alt-svc: h3-23=":443"; ma=86400
cache-control: public, max-age=604800
date: Sat, 19 Oct 2019 05:21:38 GMT
expect-ct: max-age=604800, report-uri=“https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct”
expires: Sat, 26 Oct 2019 05:21:38 GMT
last-modified: Mon, 07 Oct 2019 14:22:39 GMT
strict-transport-security: max-age=31536000; includeSubDomains
x-xss-protection: 1; mode=block
Here is the direct link it’s coming from https://ww.infinitesweeps.com/static/i/p/187673/
Cache-Control: public, max-age=604800
Date: Sat, 19 Oct 2019 05:23:05 GMT
expires: Sat, 26 Oct 2019 05:23:05 GMT
Last-Modified: Mon, 07 Oct 2019 14:22:39 GMT
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-XSS-Protection: 1; mode=block
The only page rules I have for /static/ are Mirage: On, Always Online: On, Cache Level: Ignore Query String
Can anybody please help?
I am sending the headers Cache-Control: public, max-age=604800
It’s like the rules are stuck with the old /static/i/ rules I had set. I tried purging the cache and that did not work. Links like this work correctly: https://www.infinitesweeps.com/static/i22/p/188127/makita.jpg
Cloudflare caches by file extension, not mime type. Your first link does not come with a file extension, so it would not be cached by default and you’d need a page rule for it to be cached.
That seems strange. What if the link was a html link ? domain.com/somethinghere/
Anyway, i’ve applied this rule
There are * and * at the front and beginning (they seem to be stripped off)
Browser Cache TTL: 16 days, Always Online: On, Security Level: Low, Cache Level: Ignore Query String, Edge Cache TTL: 14 days
About 10 minutes ago to the same domain, but the Canadian version for testing purposes first and it doesn’t seem to be helping either. Here is the link:
I hope that https://www.infinitesweeps.ca/static/i/p/187673/ starts loading
You need to properly format your rule, otherwise it is not clear what you configured.
Also, nothing in your rule indicates that it should cache it.
Which path do you exactly want to cache?
In that case you will need a page rule
which defines a cache everything directive.
That is the exact rule I have in there, For some reason when I posted the comment, it stripped those out of here. Here is a screen shot of the rule in cloudflare:
The path is correct, but as I earlier said
Can you please tell me which rule I am missing to actually cache it? I thought that’s what the Browse Cache TTl and Edge Cache TTL are?
You need to change the cache level to “everything”.
Defaults to the caching level option you have in your Cloudflare performance settings for the domain.
Will not cache at all
Standard / Aggressive caching
Caches all static content that has a query string in it
Ignore query string
Caches static content that has a query string and treats it as one file
Caches all file types on your site, including static content and HTML. Cloudflare Cache Everything will automatically respect any default cache headers set by the web server or CMS software like WordPress. See this article for more details on how headers affect this setting.
It will not ignore the query string, but you cant combine that. If you want these URLs cached as well you need to set it up as specified.
That worked to “cache everything”.
So it sounds like if I don’t want to cache the query strings, I will need to turn these /i/33039/ links to /i/39393.jpg or something similar?
https://www.infinitesweeps.ca/static/i/p/187673/ is treated differently than https://www.infinitesweeps.ca/static/i/p/187673/?sdlkfjsdf
If there’s some rule I can add without having to redo all of these links, it would be awesome!
If you want to ignore the query string you will need to use - as I mentioned in my very first reply - an extension which is cached by default.
Thank you for all of your help. The answer is clear now and I will make the adjustments on my end.
Have a great weekend.
This topic was automatically closed after 30 days. New replies are no longer allowed.