Search code examples
javascriptlaravellazy-loadingjquery-lazyload

Loading website faster by laravel, Load only after scroll


I am developing an ecommerce website https://www.babyshopnepal.com I am trying to load the contents of the site as the user scrolls through the page. I want to achieve functionality similar to shopclues.com i.e load contents when user scroll.

I tried to use jquery lazy load but it didn't effect any page load speed.

Any ideas how to get this functionality with laravel?


Solution

  • The answer to this question is most likely pretty Laravel-independent.

    You need to use Javascript in order to load the content (typically images) dynamically. These images can usually be retrieved without Laravel's involvement (since they can be simply accessed using http://your-site.com/your-image.jpg), so that's why no Laravel-specific solution is required.

    You mention the jQuery Lazy Load plugin yourself: Were you able to make it work, or did it fail?

    Note, by the way, that delaying the download of the images will not make Laravel generate the site faster. It will not necessarily increase the reply time. It will, however, allow users to delay the download of some potentially large image files.