Contao normally generates (resizes) the images on a page during page generation. This can lead to long page load times or, in the worst case, script timeouts due to server restrictions.
This library shifts the image calculation from page generation to the time when the image is loaded in the browser. As a result, pages will have very short loading times and script timeouts are avoided, even with hundreds of images on a page.
Search for the package and install it
agoat/contao-deferredimages
Add the package
# Using the composer
composer require agoat/contao-deferredimages
Registration and configuration is done by the manager-plugin automatically.
Add the package
# Using the composer
composer require agoat/contao-deferredimages
Register the bundle in the AppKernel
# app/AppKernel.php
class AppKernel
{
// ...
public function registerBundles()
{
$bundles = [
// ...
// after Contao\CoreBundle\ContaoCoreBundle
new Agoat\DeferredImagesBundle\AgoatDeferredImagesBundle(),
];
}
}