Missing images when cloudflare is on

Hello,

I just moved over server domains/website to cloudflare.

Sometimes images don’t load, but everything else does.

I look in console and there is a an error for example…
Failed to load resource: the server responded with a status of 521 ()

https://www.abeetza.com/contact/ ( this is missing the file pic-contact.jpg )

However the image is there, and if I turn on development mode it pops back up.

Something with the caching issue I supposed?

Any ideas.

I was able to see all the images, including the one you mentioned, both in direct hits and from CF cache. Something at your origin is resulting in error. Make sure your origin is not rate-limiting Cloudflare’s IPs.

You should contact your hosting provider and ask them to allow Cloudflare’s IP addresses https://www.cloudflare.com/ips

1 Like

Thanks for responding.

They don’t set a rate limit and those IP’s are whitelisted.

Is there someone or someplace I get get paid support for technical setups with this?

Thanks

Is there a way I can turn off Cloudflare from caching entirely throughout my 100 domains I added… either individually or as a hole setting?

When caching is off… everything works fine ( or when development mode is on )

When its on, its missing files, css, images, js etc randomly…

You should open a ticket with support, and they will be able to have a more detailed look at your issue.

As for turning cache off, you’d need to create a page rule for the relevant path pattern and set the Cache Level to Bypass.

You can, though, set your origin to send headers asking proxies not to cache such assets. You could try s-maxage=0, and see if that works. This way Cloudflare would be instructed not to cache the relevant files, but browsers would still cache them.

Thanks Floripare, how would i go about adding that s-maxage:0?

something like this on every page?

<?php header("Cache-Control: s-maxage: 0"); ?>

I tired… not sure if thats correct though and not working.

From what I can tell… I only get five page rules account wide? I have 100 domains… that means even if I can bypass it, would that mean I can only make a rule for 5 domains… or is it possible to do that a rule for every domain?

Thanks
-O

Sorry, it should be s-maxage=0

Also, you should add this setting to your “Cache-Control” header for the files that you want Cloudflare to stop caching. Currently, you are setting it only for HTML pages.

Having said that, one of the main advantages of Cloudflare is that it caches your static files. Preventing the caching of images may solve your immediate problem, but at the cost of making your pages much slower. Please consider the above only as a temporary workaround while you investigate why caching is not working for you. Have you filed a support ticket?

You need to fix the SSL at your origin, as your page is returning a “page is not safe” error. This may even be related to your images not performing as needed.

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