Search code examples
javascriptjqueryruby-on-railslazy-loadingpagespeed

Ruby on Rails - Improve page with ads and images on same page


My application is a gallery-based application. Usually I have 20 images in a page with around 15 ads (I can't remove amount of images or ads)

Images are all optimized. I use Lazy load on images and defer=true, asynchronous on the ads.

Because of the ads, Images Lazy Load waits until page is loaded before start showing the images.

Is it any way I can make the content load first and ads later? Or any solution so Lazy load doesn't wait for all ads to load before it show the images?


Solution

  • Lazy load can't know if ads have been loaded, making ads defer=true will give some helps but you might lose some ad impressions since ads are loaded after. Best way is to optimize the image and remove lazy load on pages with many ads and images in same page.