An efficient lazy loader (defer.js)

外掛說明

WordPress remains one of the most popular CMS platform until now, and I’m excited to make a WordPress plugin that focuses on minimizing payload size of HTML document and optimizing processing on the browser when rendering the web page.

⚡️ A native, blazing fast lazy loader. ✅ Legacy browsers support (IE9+). 💯 SEO friendly. 🧩 Lazy load almost anything.

Rate 5 stars (⭐️⭐️⭐️⭐️⭐️) if you guys like it.

💡 Tip for defer.js: To archive better result, please disable lazyload and HTML-CSS-JS optimizations by other plugins.

Powered by defer.js

defer.js is a super tiny, native performance library for lazy-loading JS, CSS, images, iframes…

  • ⚡️ Native API, blazing fast
  • 👍 Legacy browsers support (IE9+)
  • 🥇 SEO friendly
  • ✅ Very easy to use
  • 💯 No dependencies, no jQuery
  • 🤝 Works well with your favorite frameworks
  • 🧩 Uses IntersectionObserver API for optimized CPU usage
  • 🏞 Supports for responsive images, both srcset and sizes attributes

Easily speed up your website!

Other lazy loading libraries hook up to the scroll event on elements that need to be lazy loaded. This approach forces the browser to re-layout the page and it is painfully slow.

Here we are, defer.js is written in plain JavaScript, making lazy-loading more efficient and fast. This library is using the recently added Intersection Observer with tremendous native performance benefits.

In various cases, using async or defer does not deliver faster page speed than defer.js does.

Browser support

Available in latest browsers. This library also works perfectly with Internet Explorer 9 and later.

  • 🖥 IE9+
  • 🖥 Firefox 4+
  • 🖥 Safari 3+
  • 🖥 Chrome *
  • 🖥 Opera *
  • 📱 Android 4+
  • 📱 iOS 3.2+

Keep in touch

Released under the GNU General Public License v2 license.
https://github.com/shinsenter/defer-wordpress/blob/master/LICENSE

Copyright (c) 2019 Mai Nhut Tan <shin@shin.company>

螢幕擷圖

  • Scoring 100/100 in Google PageSpeed Test!
  • Defer almost anything, easily speed up your website.

安裝方式

  1. Upload defer-wordpress to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress

常見問題集

What is defer.js?

🥇 A super tiny, native performance library for lazy-loading JS, CSS, images, iframes… Defer almost anything, easily speed up your website.

Why should I lazy-load my content?

The loading of contents on web page may make your load speed more slow, no one likes staring at a blank white page; users are impatient and will leave quickly.

Lazy loading content on web page can help reduce resource contention and improve performance.

使用者評論

2020 年 9 月 26 日
Specifically the svg placeholder option is a gem, we have been using this technique for quiet some time and it's good at preventing layout shift if used properly. Remember to always provide a width & height for your images so this could work!
2020 年 6 月 28 日
Awesome plugin, one of the best speed optimization Plugins out there, and geat for boosting your Page Speed Scores.
2020 年 6 月 17 日
He probado todo tipo de herramientas, plugins y códigos, de momento el único que nos ha dado excelentes resultados es este.
2020 年 5 月 12 日
All the settings may not be for you, and you may need to set rules in functions.. but once it's set up... it works flawlessly. (The only lazy loader plugin I could get to work well with dynamically set up webp picture/source tags)
閱讀全部 36 則使用者評論

參與者及開發者

以下人員參與了開源軟體〈An efficient lazy loader (defer.js)〉的開發相關工作。

參與者

變更記錄

1.1.11 Fixed security issue (Fixed CVE-2019-18888)

1.1.10+5 Removed external resources

1.1.10 Bug fixes and improvements

1.1.9 Fixed wrong encoding when using mb_detect_encoding() function

1.1.8 Updated defer.php library (v1.0.15)

1.1.7 Fixed issues of FireFox, code improvements

1.1.6 Updated library version, improved javascript execution order

1.1.5 Hotfix: Escape HTML node value

1.1.4 Many improvements

1.1.3 Unify lazy attributes of another plugins

1.1.2 Fixed some known issues with gtm.js, improve library’s caches

1.1.1 Small bug fixes (IE polyfill, missing meta tags, preloading ads)

1.1.0 Added settings page

1.0.9 Imrpoved preloading code

1.0.8 Fixed issues with open web fonts

1.0.7 Optimized scriptloader, polyfill, scrset

1.0.6 Small bug fixes (color placeholders, css)

1.0.5 Migrated with defer.js library

1.0.0 ~ 1.0.4 The first implement