Download the PHP package elgentos/magento2-clientside-cache without Composer
On this page you can find all versions of the php package elgentos/magento2-clientside-cache. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download elgentos/magento2-clientside-cache
More information about elgentos/magento2-clientside-cache
Files in elgentos/magento2-clientside-cache
Package magento2-clientside-cache
Short Description Elgentos Clientside Cache
License GPL-3.0-or-later
Informations about the package magento2-clientside-cache
Magento 2 Clientside Cache
Magento already had support for ESI blocks, this will add an easy way to replace page heavy or slow blocks and load them asynchronous without much hassle.
Installation
Usage
The easiest way is to add the <block class="Elgentos\ClientsideCache\Block\Async" />
around the original block, and use the correct alias as=""
so the original block knows how which getChildHtml
to fetch.
layout/LAYOUT_HANDLE.xml
Limit handles
You can limit the handles within the Async wrapper. This increases the possibility to re-use requests. An example would be menu's which are the same on every page.
layout/default.xml
Features
- Fetch content async
- Group similar requests for handles into on one single request
- Evaluate Javascript
Javascript
If you want to make sure that your global functions or objects are available you need to make sure to assign them to global scope. Some examples;
Custom integration
It's also possible to do custom integration too.
Use clientsideCacheAsync
which will return a Promise and will with a object for all blocks you requested.
Special thanks
The module was created during the Hackthon before the Mage Unconference in Cologne. Thanks to the team for organising another great event and for the Hackathon.