Download the PHP package shinsenter/defer.php without Composer
On this page you can find all versions of the php package shinsenter/defer.php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download shinsenter/defer.php
More information about shinsenter/defer.php
Files in shinsenter/defer.php
Package defer.php
Short Description 🚀 A PHP library that focuses on minimizing payload size of HTML document and optimizing processing on the browser when rendering the web page.
License MIT
Informations about the package defer.php
defer.php
🚀 A PHP library that aims to help you concentrate on web performance optimization.
- Package: @shinsenter/defer.php
- Version: 2.5.0
- Author: Mai Nhut Tan [email protected]
- Copyright: 2019-2023 SHIN Company https://code.shin.company/defer.php
- License: MIT
🥇 Powered by defer.js - A super small, super efficient library that helps you lazy load almost everything like images, video, audio, iframes as well as stylesheets, and JavaScript.
Features
- [x] Simplify library options
- [x] Embed defer.js library
- [x] Normalize DOM elements
- [x] Fix missing meta tags
- [x] Fix missing media attributes
- [x] Preconnect to required origins
- [x] Preload key requests
- [x] Prefetch key requests
- [x] Browser-level image lazy-loading for the web
- [x] Lazy-load offscreen and hidden iframes
- [x] Lazy-load offscreen and hidden videos
- [x] Lazy-load offscreen and hidden images
- [x] Lazy-load CSS background images
- [x] Reduce the impact of JavaScript
- [x] Defer non-critical CSS requests
- [x] Defer third-party assets
- [x] Add fallback
<noscript>
tags for lazy-loaded objects - [x] Add custom HTML while browser is rendering the page (splashscreen)
- [x] Attribute to ignore optimizing the element
- [x] Attribute to ignore lazyloading the element
- [x] Optimize AMP document
- [x] Minify HTML output
Installation
Install with composer
Load the library into your program
Requirements
This library requires PHP 5.6 or above so you need this version or the latest version of PHP installed on your system.
It recommends that the server is running PHP version 7.3+ or above for better performance and supports.
Library options from v2.x are not backward compatible with previous release's options. Please read library manual for more details.
Usages
Basic usage
Options
Optimize final output HTML of a website
You also can capture the final output generated by PHP and optimize it before giving it back to browser.
Ignore optimization for some elements
Add an data-ignore
attribute to element that you don't want it to be optimized by the library.
This attribute can be used for all HTML elements.
Add an data-nolazy
attribute to element that you don't want it to be lazy-loaded by the library.
Other optimizations for that element will still be applied except lazy-load.
This attribute can be used for all <img>
, <picture>
, <video>
, <audio>
, <iframe>
and also <link rel="stylesheet">
elements.
Stylesheets and JavaScript
This library supports a more efficient lazy-load method for stylesheets and JavaScript tags that contain the defer
attribute.
Even when the library is turned off, above tags that contain defer
attribute are backwards compatible and work well in most modern browsers. You can use it with peace of mind.
AMP page
Only few options of this library are applicable to AMP pages (minifying HTML content for example).
My works
Defer.js
https://code.shin.company/defer.js/
🥇 A super small, super efficient library that helps you lazy load almost everything like images, video, audio, iframes as well as stylesheets, and JavaScript.
Wordpress plugin
https://code.shin.company/defer-wordpress/
⚡️ A native, blazing fast lazy loader. ✅ Legacy browsers support (IE9+). 💯 SEO friendly. 🧩 Lazy-load everything.
Laravel package
https://code.shin.company/defer-laravel/
🚀 A Laravel package that focuses on minimizing payload size of HTML document and optimizing processing on the browser when rendering the web page.
Support my activities
From Vietnam 🇻🇳 with love.
All versions of defer.php with dependencies
ext-libxml Version *
lib-libxml Version >=2.7.7
mrclay/jsmin-php Version ^2.0
psr/simple-cache Version ^1.0
symfony/css-selector Version ^2.0 || ^3.0 || ^4.0 || ^5.0 || ^6.0
symfony/options-resolver Version ^2.0 || ^3.0 || ^4.0 || ^5.0 || ^6.0
symfony/polyfill-mbstring Version ^1.0