內容簡介
透過延時載入圖片,提高網站使用者體驗及 SEO 排名。
什麼是延時載入?
「延時載入是一項技術,它將非關鍵資源的載入推遲到頁面載入時間以後。而這些非關鍵資源會在需要時才載入。」
- Jeremy Wagner,Google 開發人員
換言之,
透過延時載入圖片,讓圖片異步載入,可以有條件地載入(例如,當它們在訪客的視窗內時)。這樣,您可以防止您的訪客下載他們永遠看不到的圖片。
有哪些優點?
對訪客而言,主要好處如下:
1. 較短的頁面載入時間
初始載入的資源減少,自然可以減少載入時間。當您的網站上有越多圖片,則效果更加明顯,可能會對訪客體驗及 SEO 排名產生重大影響。
2. 較小的頁面大小
有可能您的訪客不會從頂端滾動到底部,因此不會載入所有圖片。少載入幾張圖片對於無限制的連線可能不太重要。然而,對於在有流量限制的方案上瀏覽您的網站的訪客,可以避免他們浪費流量。再次,這是影響您的 SEO 排名的因素。
瀏覽器支援
Be Lazy 可以通過 IntersectionObserver API 的 polyfill 支援不支援該 API 的瀏覽器。因此,幾乎所有瀏覽器都得到支援。
✔ Google Chrome
✔ Mozilla Firefox
✔ Opera
✔ Microsoft Edge
✔ Microsoft Internet Explorer(7+)
✔ Safari(6+)
✔ Android 瀏覽器(4.4+)
外掛標籤
開發者團隊
原文外掛簡介
Enhance your website’s user experience and seo ranking by lazy loading images.
What is lazy loading?
«Lazy loading is a technique that defers loading of non-critical resources at page load time. Instead, these non-critical resources are loaded at the moment of need.»
– Jeremy Wagner, Google Developer
In other words:
Lazy loading images makes them being loaded asynchronously which makes it possible to load them conditionally (e.g. when they are within the visitors’s viewport). In doing so, you will prevent your visitors from downloading images they would never see anyway.
What are the advantages?
The main advantages for your visitors are:
1. Reduced page load time
Having to initially load less resources, naturally reduces the loading duration. This will be more noticeable the more images you have on your website and may have a critical impact on your visitors’s experience as well as your SEO ranking.
2. Smaller page size
It’s possible that your visitors will not scroll down to the very bottom of the page and therefore not load all images. Having to load a few images less might not be relevant on unlimited connections. For visitors browsing your website on limited plans however, you’ll prevent them from wasting their data allowances. Again, this is a factor influencing your SEO ranking.
Browser support
Be Lazy uses a polyfill for browsers not supporting the IntersectionObserver API by default. As a result, pretty much any browser is supported.
✔ Google Chrome
✔ Mozilla Firefox
✔ Opera
✔ Microsoft Edge
✔ Microsoft Internet Explorer (7+)
✔ Safari (6+)
✔ Android Browser (4.4+)
