I believe the root issue is that Chrome isn't caching the image. In this demo, Chrome will issue a new request every time you click the button.
The lazy load script triggers 2 requests because it first (pre)loads the image into a private img
element, then it assigns the image URL to the original img
element.
I suggest adding an Expires
or Cache-Control
header, and a Last-Modified
or ETag
header, to the response from your image handler so that Chrome will cache the image. (For more on caching, see the Caching Tutorial for Web Authors and Webmasters.)
Update: I suggest adding something like this to your image handler (from MSDN):
Response.Cache.SetExpires(DateTime.Now.AddSeconds(60));
Response.Cache.SetCacheability(HttpCacheability.Public);
Response.Cache.SetValidUntilExpires(true);