Trabajar no necesariamente debe ser solitario

Trabajar solo es en ocasiones hasta necesario, si quieres que el trabajo esté bien hecho hazlo tu mismo, pero no siempre debe ser así o al menos no de cierto modo. Por si no lo sabias, el humano por…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Speed up your website by making it lazy

When users first visit your webpage, the default behaviour of the browser is to automatically download all of the content on the entire page. So for example, if you have a really long page with a lot of images, every single image is downloaded by the browser regardless of whether it is visible or not, as illustrated below.

Issue 1 — this can impact the speed in which your page first loads, which user testing has proved to be highly important for a good experience. Users are far more likely to navigate away from a site if they are forced to wait for content to load. If the site or application has a lot of images, then the browser will take longer to display everything.

Issue 2 — by forcing users to automatically download everything on your page, you are possibly eating away at their data plan, particularly if they are viewing your content on a mobile device. Users may have a small data allowance or might be viewing your site on a poor network. If they are forced to download a lot of image files that they might not even scroll to and view, then they probably won’t thank you for it.

To combat this, lazy loading can be added to your site. So what exactly is lazy loading? When the page first loads, it is important to only load the images that are actually ‘required’ and need to be displayed. When the user then scrolls down the page, the images can be loaded as and when they are required.

As you can see from the illustration above, by adding lazy loading, users will only initially download images that are immediately required and visible on the screen. So it’s a win for making your site load faster as well as giving your users a better experience.

Yes you can. The techniques used to achieve lazy loading are fully supported in the majority of major browsers including Chrome, Firefox and Microsoft Edge. There is no support in earlier versions of Internet Explorer, and at the time of writing they are in development in Safari for future support.

As a temporary fallback when not supported, you can still by default load all of the images on the page, which is where your site or application currently sits right now by default. However for users using browsers that offer support for lazy loading, you can greatly improve their experience and when Safari eventually adds support, your site will automatically lazy load the images there too.

Add a comment

Related posts:

Guide to the Stash of Powder and Arms Voyages

Around the holiday season, Larinna the Bilge Rat (hanging around just outside the tavern on every outpost) has a free “Stash of Powder and Arms” voyage for each of the game’s four regions, including…

6 Household Herbs to Boost Your Immunity!

It was a cold and rainy evening in Bangalore. Mom was concerned that I wasn’t back home from work. It was pouring outside. The clock struck 9 PM, and the doorbell rang. Granny: No need for tablets…

How to handle too many sleeping connections in aws rds.

There was a Cron job which was scheduled every day in the morning when there was close to zero traffic to the db. This cron job was a heavy Insert task which opened close to 1000 connections on an…