Does cloudflare try to fetch assets listed in a css file ahead of time?

I have a css file with 500 images embedded as background images with the css url function. Browsers will only load images that are shown on screen, but I noticed in my server logs that from time to time, all of the 500 images were fetched in a row.

I thought that maybe when Cloudflare served the css file, it parsed it and fetched all the images to be ready when the browser will run the css file itself and ask for some of the images listed.

Cloudflare doesn’t do that, no. But there is no guarantee that a browser will behave as you expect and only download images that are actually being displayed (and older ones certainly won’t behave that way).

1 Like

Thank you @i40west.

I had a difficult time to find authoritative content about how browsers handle this situation, but given the user agents I have in the log I am pretty sure this is not a browser that tries to fetch all these assets at once (plus, the number of concurrent calls are limited in the browser).

Now I need to find another explanation. Thank you.

It could be as simple as a search engine indexing the images.

1 Like

Good idea, but this is an internal tool only visible to authenticated users, and from the logs I can see that what triggers the calls is a legit user behaviour.

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