|
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
| setDirectives ($directives) | |
| load ($id, $doNotTestCacheValidity=false) | |
| test ($id) | |
| save ($data, $id, $tags=array(), $specificLifetime=false) | |
| remove ($id) | |
| clean ($mode=Zend_Cache::CLEANING_MODE_ALL, $tags=array()) | |
Definition at line 30 of file Interface.php.
| clean | ( | $mode = Zend_Cache::CLEANING_MODE_ALL, |
|
$tags = array() |
|||
| ) |
Clean some cache records
Available modes are : Zend_Cache::CLEANING_MODE_ALL (default) => remove all cache entries ($tags is not used) Zend_Cache::CLEANING_MODE_OLD => remove too old cache entries ($tags is not used) Zend_Cache::CLEANING_MODE_MATCHING_TAG => remove cache entries matching all given tags ($tags can be an array of strings or a single string) Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG => remove cache entries not {matching one of the given tags} ($tags can be an array of strings or a single string) Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG => remove cache entries matching any given tags ($tags can be an array of strings or a single string)
| string | $mode | Clean mode |
| array | $tags | Array of tags |
Implemented in Zend_Cache_Backend_Static, MongoDb, Zend_Cache_Backend_File, Zend_Cache_Backend_TwoLevels, Database, Zend_Cache_Backend_Memcached, Zend_Cache_Backend_Libmemcached, Zend_Cache_Backend_Test, Zend_Cache_Backend_ZendServer, Zend_Cache_Backend_ZendPlatform, Zend_Cache_Backend_Xcache, RemoteSynchronizedCache, Zend_Cache_Backend_Apc, Zend_Cache_Backend_WinCache, AbstractDecorator, Eaccelerator, and Zend_Cache_Backend_BlackHole.
| load | ( | $id, | |
$doNotTestCacheValidity = false |
|||
| ) |
Test if a cache is available for the given id and (if yes) return it (false else)
Note : return value is always "string" (unserialization is done by the core not by the backend)
| string | $id | Cache id |
| boolean | $doNotTestCacheValidity | If set to true, the cache validity won't be tested |
Implemented in MongoDb, Zend_Cache_Backend_TwoLevels, Zend_Cache_Backend_File, Zend_Cache_Backend_Memcached, Zend_Cache_Backend_Libmemcached, Database, Zend_Cache_Backend_Static, RemoteSynchronizedCache, Memcached, Zend_Cache_Backend_Test, Zend_Cache_Backend_Xcache, Zend_Cache_Backend_ZendServer, Zend_Cache_Backend_ZendPlatform, Zend_Cache_Backend_Apc, Zend_Cache_Backend_WinCache, AbstractDecorator, Zend_Cache_Backend_BlackHole, Eaccelerator, and Compression.
| remove | ( | $id | ) |
Remove a cache record
| string | $id | Cache id |
Implemented in MongoDb, Zend_Cache_Backend_Static, Zend_Cache_Backend_File, Zend_Cache_Backend_TwoLevels, Database, Zend_Cache_Backend_Memcached, Zend_Cache_Backend_Libmemcached, Zend_Cache_Backend_Test, Zend_Cache_Backend_ZendServer, Zend_Cache_Backend_ZendPlatform, RemoteSynchronizedCache, Zend_Cache_Backend_Xcache, Zend_Cache_Backend_Apc, Zend_Cache_Backend_WinCache, AbstractDecorator, Eaccelerator, and Zend_Cache_Backend_BlackHole.
| save | ( | $data, | |
| $id, | |||
$tags = array(), |
|||
$specificLifetime = false |
|||
| ) |
Save some string datas into a cache record
Note : $data is always "string" (serialization is done by the core not by the backend)
| string | $data | Datas to cache |
| string | $id | Cache id |
| array | $tags | Array of strings, the cache record will be tagged by each string entry |
| int | $specificLifetime | If != false, set a specific lifetime for this cache record (null => infinite lifetime) |
Implemented in MongoDb, Zend_Cache_Backend_File, Zend_Cache_Backend_Static, Zend_Cache_Backend_Memcached, Database, Zend_Cache_Backend_Libmemcached, Zend_Cache_Backend_Test, RemoteSynchronizedCache, Zend_Cache_Backend_ZendServer, Zend_Cache_Backend_Xcache, Zend_Cache_Backend_ZendPlatform, Zend_Cache_Backend_Apc, Zend_Cache_Backend_WinCache, Memcached, Eaccelerator, and Zend_Cache_Backend_BlackHole.
| setDirectives | ( | $directives | ) |
Set the frontend directives
| array | $directives | assoc of directives |
Implemented in Zend_Cache_Backend_Memcached, Zend_Cache_Backend_Libmemcached, RemoteSynchronizedCache, Zend_Cache_Backend_Test, and AbstractDecorator.
| test | ( | $id | ) |
Test if a cache is available or not (for the given id)
| string | $id | cache id |
Implemented in MongoDb, Zend_Cache_Backend_File, Zend_Cache_Backend_Memcached, Zend_Cache_Backend_Libmemcached, Zend_Cache_Backend_TwoLevels, Database, Zend_Cache_Backend_Static, Zend_Cache_Backend_Test, RemoteSynchronizedCache, Zend_Cache_Backend_ZendPlatform, Zend_Cache_Backend_Xcache, Zend_Cache_Backend_ZendServer, Zend_Cache_Backend_Apc, Zend_Cache_Backend_WinCache, AbstractDecorator, Zend_Cache_Backend_BlackHole, and Eaccelerator.