CDN performing very slow for images

#1

The HTTP response headers for this URL seem to indicate its coming via cloudflare, but 400MS seems to be a very long time to download a 40KB image: https://media.rootrez.com/media/images/property/1361/5554eee1ae13f?width=394&height=320

HTTP response headers:

cf-ray: 4d6ef383c876d35e-LAX
content-type: image/jpeg
date: Tue, 14 May 2019 18:31:49 GMT
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
referrer-policy: no-referrer
server: cloudflare
status: 200
strict-transport-security: max-age=631138519; includeSubDomains
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block

Perhaps I need to change something with the origin servers apache response headers?

#2

I created a custom page rule to cache everything here. I think maybe because the image doesn’t have an extension it was not being cached? Though it was returning correct content type. Can someone confirm this issue?

#3

image

image

here Cf-Cache-Status is MISS, so TTFB is probably combination of origin +5-10ms.


A reload, with cache HIT, shows 40ms ttfb:

image

image

It probably took a few minutes for the file to begin being cached at LAX.

1 Like
#4

We cache based on extension not content type, so your fix was the correct one.

3 Likes