Swiper: Lazy Load, Each slide image is loaded twice

Created on 24 May 2019  路  7Comments  路  Source: nolimits4web/swiper

When lazy load is enabled, each slide image gets loaded twice as seen in the network tab of my browser. Is this expected? Its really nice to cut down on the initial load of the page, but if someone interacts through the slider, they end up consuming double the data in the end compared to not lazy loading at all.

Not sure if this is a bug or expected behavior or if im not understanding what is happening in the network tab.

This is a (multiple allowed):

  • [x] bug ??
  • [ ] enhancement
  • [x] feature-discussion (RFC)

Expected Behavior

Each slide image only loaded once.

Actual Behavior

Each slide image data is loaded twice as seen through the browsers developer tools network tab.

Most helpful comment

Go to http://idangero.us/swiper/demos/370-lazy-load-images.html
Open dev tools, make sure that Disable cache is not checked
See how many times image is loaded

All 7 comments

Any response?

same here

+1

Same here,

If that helps, here are 2 stacks of the image loads:

image

image

it seems related to image caching not being enabled, so when image loads and we update image src attribute it reloads again instead of using the already loaded version

https://github.com/nolimits4web/swiper/issues/3017

good find, disappointing that the author closed that ticket and blamed server caching. We have server caching on and it still loads images twice on our sites. weve been conflicted as to whether we should even bother using the lazy load feature because people will end up using more data if they ever interact with the site sliders.

Go to http://idangero.us/swiper/demos/370-lazy-load-images.html
Open dev tools, make sure that Disable cache is not checked
See how many times image is loaded

Was this page helpful?
0 / 5 - 0 ratings