@@ -16,7 +16,7 @@ class Compression extends \Magento\Framework\Cache\Backend\Decorator\AbstractDec
1616 /**
1717 * Prefix of compressed strings
1818 */
19- const COMPRESSION_PREFIX = 'CACHE_COMPRESSION ' ;
19+ public const COMPRESSION_PREFIX = 'CACHE_COMPRESSION ' ;
2020
2121 /**
2222 * Array of specific options. Made in separate array to distinguish from parent options
@@ -50,18 +50,17 @@ public function load($cacheId, $noTestCacheValidity = false)
5050 * Note : $data is always "string" (serialization is done by the
5151 * core not by the backend)
5252 *
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
6059 * @return bool true if no problem
6160 */
6261 public function save ($ data , $ cacheId , $ tags = [], $ specificLifetime = false , $ priority = 8 )
6362 {
64- if ($ this ->_isCompressionNeeded ($ data )) {
63+ if ($ data !== null && $ this ->_isCompressionNeeded ($ data )) {
6564 $ data = self ::_compressData ($ data );
6665 }
6766
0 commit comments