I’m using Youtube video stills on my website as a way to “lazy load” the videos (when a user clicks the stills, then the video player is actually called). Right now, I’m using Youtube’s URL to grab the image(https://i.ytimg.com/vi/{some video id}/maxresdefault.jpg). My question is whether Cloudflare can cache this image (doubtful…) or whether I would need to download the image to my server and then serve it through there in order for it to be cacheable.
CF doesn’t have control over i.ytimg.com so it can’t serve/cache the files from there.
In general, linking to the image shouldn’t be that expensive/slow. The only downside is the DNS lookup and TLS, which can maybe take 100ms of time depending on how fast the connection is to the Google DC and how fast the user’s DNS resolver is.
A test on Fiber to https://i.ytimg.com (disregard “blocked”)
You will load a little faster in terms of saving time by not doing DNS and TLS if you choose to re-host the thumbnail yourself. Cloudflare would then be able to cache that thumbnail for you.