Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/old/app/code/Soon/AdvancedCache/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/corals/old/app/code/Soon/AdvancedCache/README.md
# Installation

> **CAUTION** - Make sure that you have active credentials on packages.agence-soon.fr for downloading Soon_* extensions. Please read https://confluence.kaliop.net/pages/viewpage.action?pageId=35009827

## Update your project's composer.json file

Edit the `composer.json` file at the root of your installation and, in the `repositories` section, make sure that you find the following:

```
{
    "type": "composer",
    "url": "http://packages.agence-soon.fr/"
}
```

## Get the extension and deploy it

- Require the extension: `composer require "soon/module-advanced-cache:~1"` 
- Enable the extension: `php bin/magento module:enable Soon_AdvancedCache`
- Run system upgrade: `php bin/magento setup:upgrade`

# Blocks cached by default by Soon_AdvancedCache

* `content` block of CMS pages
* all CMS blocks
* `product_list` blocks
* `search_result_list` blocks
* some product view related blocks

# Defining additional blocks to cache

Everything happens in layout files.

Please have a look at the provided layout files: `view/frontend/layout/*` for commented XML.

# Caching blocks created by code

As blocks created by code (rather than by layout) are very often not cached, a good trick to cache them is:

1. Inject `\Soon\AdvancedCache\Model\Cache\ProcessorInterface` in your constructor
2. Call its `cacheBlock` method and pass the block to cache as first argument and `true` as second argument

Exemple:

```
/**
    @var $this->processor \Soon\AdvancedCache\Model\Cache\ProcessorInterface
    @var $block \Magento\Framework\View\Element\BlockInterface
*/
$this->processor->cacheBlock($block, true);
```

# What are "engines"?

Engines are models that define a logic for caching a block:

* can this block be cached?
* what are its cache tags, cache lifetime and cache key and how are they built?
* what does really happen when caching the block (or maybe its children)?

Soon_AdvancedCache is shipped with a default engine and an engine for CMS pages based on the default engine.

Spamworldpro Mini