@@ -16,7 +16,7 @@ class Compression extends \Magento\Framework\Cache\Backend\Decorator\AbstractDec
16
16
/**
17
17
* Prefix of compressed strings
18
18
*/
19
- const COMPRESSION_PREFIX = 'CACHE_COMPRESSION ' ;
19
+ public const COMPRESSION_PREFIX = 'CACHE_COMPRESSION ' ;
20
20
21
21
/**
22
22
* Array of specific options. Made in separate array to distinguish from parent options
@@ -50,18 +50,17 @@ public function load($cacheId, $noTestCacheValidity = false)
50
50
* Note : $data is always "string" (serialization is done by the
51
51
* core not by the backend)
52
52
*
53
- * @param string $data Datas to cache
54
- * @param string $cacheId Cache id
55
- * @param string[] $tags Array of strings, the cache record will be tagged by each string entry
56
- * @param bool $specificLifetime If != false, set a specific lifetime for this cache record
57
- * (null => infinite lifetime)
58
- * @param int $priority integer between 0 (very low priority) and 10 (maximum priority) used by
59
- * some particular backends
53
+ * @param string $data Datas to cache
54
+ * @param string $cacheId Cache id
55
+ * @param string[] $tags Array of strings, the cache record will be tagged by each string entry
56
+ * @param bool $specificLifetime If != false, set a specific lifetime for this cache record
57
+ * (null => infinite lifetime)
58
+ * @param int $priority integer between 0 (very low priority) and 10 (max priority) used by some particular backends
60
59
* @return bool true if no problem
61
60
*/
62
61
public function save ($ data , $ cacheId , $ tags = [], $ specificLifetime = false , $ priority = 8 )
63
62
{
64
- if ($ this ->_isCompressionNeeded ($ data )) {
63
+ if ($ data !== null && $ this ->_isCompressionNeeded ($ data )) {
65
64
$ data = self ::_compressData ($ data );
66
65
}
67
66
0 commit comments