-8

Lets say I have an ecommerce site with 15,000 image elements to insert into the html, whats the most efficient method using javascript to increase efficiency and user experience?

caffeinescript
  • 1,365
  • 2
  • 13
  • 27

2 Answers2

0

Load the images only when they are in the view port.

This question tells you how:

How do you make images load only when they are in the viewport?

Community
  • 1
  • 1
Charlie
  • 22,886
  • 11
  • 59
  • 90
0

Preload the images and use the cdn to host your images.

You can use something like https://github.com/thinkpixellab/PxLoader to preload the images.

Ali Raza
  • 147
  • 1
  • 10