Some pngs not caching

Hi,
I’m testing to see if my images are caching on my webpage and the one attached (rainbow png) simply doesn’t. Always a MISS.
Other pngs I add HIT fine immediately.

Any idea why that is?
Thanks
Image that won’t cache:
testrainbow

I also noticed even PNGs I test sourced off cloudflare.com like that attached below don’t cache and throw a MISS. Testing the Cloudflare Free plan so not sure if that prevents PNGs from caching/Hitting?
Thanks

Untitled

Post the image URLs in a Ctrl - E block

Most of the images on my test page: https://yalanger.com/ MISS

If it’s not in the cache, it will always be a cache miss, however then it’s served from the cache

$ curl -I https://yalanger.com/wp-content/uploads/2024/01/img2.jpg | grep cache
cf-cache-status: HIT

Do you have an actual URL where you can reproduce that?

https://yalanger.com/wp-content/uploads/2024/01/img_480x360_3x16bit_RGB_color_bars_CMYKWRGB-Copy-Copy-2-300x225.png
https://yalanger.com/wp-content/uploads/2024/01/CFJPG.jpg
https://yalanger.com/wp-content/uploads/2024/01/file_example_PNG_500kB-300x200.png
https://yalanger.com/wp-content/uploads/2024/01/cloudpng.png

Second request is immediately served from the cache

$ curl -I https://yalanger.com/wp-content/uploads/2024/01/img_480x360_3x16bit_RGB_color_bars_CMYKWRGB-Copy-Copy-2-300x225.png | grep cache
cf-cache-status: HIT
C:\Users\hcann>curl -I https://yalanger.com/wp-content/uploads/2024/01/img_480x360_3x16bit_RGB_color_SMPTE_RP_219_2002-300x225.png
HTTP/1.1 200 OK
Date: Wed, 10 Jan 2024 20:41:50 GMT
Content-Type: image/png
Content-Length: 2225
Connection: keep-alive
cache-control: public, max-age=604800
expires: Wed, 17 Jan 2024 20:41:50 GMT
last-modified: Wed, 10 Jan 2024 12:47:18 GMT
etag: "8b1-659e91d6-61372009e0f5394b;;;"
vary: User-Agent
x-turbo-charged-by: LiteSpeed
CF-Cache-Status: MISS
Accept-Ranges: bytes
Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=rHeBy4Dm1kdJnocxW7FOsXFoEMfA5ZnuDCWWvFdff1hcIo9mHdtywebhnw5SfeCor2%2B90iPRTT3ChSqHdIQnPVgaJ7DNYSeRdu1J0dTjX0IYT2nAyGUqCMmD18EsPC0%3D"}],"group":"cf-nel","max_age":604800}
NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
Server: cloudflare
CF-RAY: 8437be3b6f595e64-EWR
alt-svc: h3=":443"; ma=86400


C:\Users\hcann>

Run it twice.

Caching doesn’t seem to be the issue. You do have a security issue though, as you don’t have a valid certificate on your server and an insecure encryption mode on Cloudflare.

Ok thanks…I will investigate more. The DR Flare Chrome addon at https://chromewebstore.google.com/detail/drflare/pibckhncbjabhlomohgcdedacopeooml seems to be buggy and maybe confusing me as it shows certain images always MISSing. I’m also using the Browser Headers inspector to determine if I HIT/MISS and it shows a lot of images missing. I will stick with the curl method! Just learning Cloudflare environment at the moment. Thanks

No worries, it always takes a few requests but the URL you posted eventually got cached. Keep in mind it is datacentre specific.

$ curl -I https://yalanger.com/wp-content/uploads/2024/01/img_480x360_3x16bit_RGB_color_SMPTE_RP_219_2002-300x225.png | grep cache
cf-cache-status: HIT

However, you do need to fix the certificate issue as your site is insecure at the moment.

Thanks. I just applied a Lets Encrypt SSL cert to yalanger.com so hopefully that helps with the security. Exploring DirectAdmin

Great, the certificate seems to be in place, but you also need to fix the encryption mode on Cloudflare, otherwise the certificate won’t take effect.

Make sure it is set to Full Strict on Cloudflare.

Just set it to Full Strict now. It was on Flexible. Thanks very much!

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