We have a website that contains 20,000+ media. It serves images and videos per post(500 post as of now). Opening posts takes a very long time to open because it contains images(500+) and videos(50+).

Each post displays gallery/collection of images thumbnail(150x150) and if the images are clicked then it will popup a lightbox displaying it with fullscreen with a swipe functions.

Added to that, There are videos(100+) that uses videojs in each post also not just the image gallery.

-We cannot try to serve it via webp as the images are not in our server (Uploaded directly to CDN). -We don't compress the images as we wanted it to be high resolution and it takes too much storage.(Added CDN costs for storages.)

We have tried to disable some scripts and css but it cannot help to load too much images.

We also tried to use cache but it doesnt help also (we have login/dynamic page)

We also tried using a3 lazy load but doesn't help either

We need more suggestions to reduce the amount of time to load. We are thinking about load the page first then image one by one so that the users do not feel boredom as the page takes time to load but the post loads all image not being lazy loaded or just delay the load of images for that the page will load faster first.

Any suggestion? Thanks!

Currently using

VPS 2GB RAM 2CPU Apache2

  • Given the processing demands of rendering DOM elements, have you considered react-window or react-virtualized?
    – kofeigen
    May 1 at 2:55
  • Hi thank you for suggesting but we didnt tried that yet as we do know how to use that( Not a wordpress plugin). We just modify the loop code to display each individual image. We do not know how to use with react. May 7 at 8:43
  • Would you like to try to use it? Since it is front-end, it could involve working more with WordPress data modules to get Post data. It might help you with your performance issues.
    – kofeigen
    May 7 at 9:15
  • Hi. Yes. We are trying to apply the react-window but we dont know how to execute it well as we do not have any idea on how to import react in wordpress. May 11 at 17:21
  • The latest versions of WordPress use React and already have it. What version of WordPress are you using? Is your project open-source? Can your code be accessed in a public repository?
    – kofeigen
    May 12 at 22:57


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.