Image Resizing - Lazy Loading?

After implementing Image Resizing, it seems clear that CF Polish and Mirage should be turned off. The Speed Optimization Recommendations advises that explicitly. I suppose the Image Resizing worker is taking care of their functions for the most part.

My question is about Lazy Loading. Does Image Resizing implement lazy loading by default (along the lines of Mirage)?

If so, my trouble arises because I do not want above-the-fold header images to be lazy loaded. Would there be a way to fine tune things and exclude them from lazy loading?

I should mentioned that I am also using CF APO and the wp-rocket plugin on this WordPress site. Wp-rocket uses a javascript lazy loading solution and does allow exclusions. For this reason, my preference is for the wp-rocket lazy loading parameters to carry forward to Cloudflare Image Resizing.

Thank you

Typically, lazy-loading is done by adding the appropriate directives to your HTML. Javascript also works, and is the older method from before browsers natively supported it (and are probably still more flexible).

Both methods are independent of the image URLs and anything done by Image Resizing, so using Image Resizing shouldn’t affect it. I’ve never used Mirage, so I don’t know how badly it would play with Image Resizing, but your existing lazy-loading Javascript should continue to work just fine.


Yes, but I am wondering if either CF Image Resizing or APO are adding


to image links.

This blog post implies some kind of lazy loading happening with the APO service activated.

I am hoping that someone with knowledge of how that service works could explain further. I suppose the title of this Topic could have been “Cloudflare APO - default lazy loading?”

I should add, however, that my tests indicate that Image Resizing" is the culprit.


Image Resizing doesn’t touch your HTML and won’t do lazy-loading by itself.

Mirage does lazy-loading. I don’t know if that’s part of APO.


Thank you for responding.

I thought when Image Resizing processes an image it rewrites the image URL like this:

And I am wondering if that rewriting includes the addition of a loading=lazy parameter. I don’t see it in any of the documentation, but it sure seems like to me.

Image Resizing doesn’t rewrite your HTML at all. You use Image Resizing by changing your image URLs as that page describes. It’s not automatic.

If you want automatic that’s what Mirage and Polish are for. They use the same image processing functions behind the scenes.


OK. Thank you for confirming that Cloudflare Image Resizing does not add attributes (like loading=lazy) to the HTML output. It only rewrites the image URLs.

No. It rewrites nothing. You use Image resizing by changing the URLs. It does nothing automatically.


Yes, understood. A new URL is the way to request a resized image.

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