Fixed bug #11326: Memcached backend does not work well if cache of a page shall expir...
[Packages/TYPO3.CMS.git] / t3lib / cache / backend / class.t3lib_cache_backend_memcachedbackend.php
index b5a6660..6f73a28 100644 (file)
@@ -224,6 +224,12 @@ class t3lib_cache_backend_MemcachedBackend extends t3lib_cache_backend_AbstractB
                $tags[] = '%MEMCACHEBE%' . $this->cache->getIdentifier();
                $expiration = $lifetime !== NULL ? $lifetime : $this->defaultLifetime;
 
+                       // Memcached consideres values over 2592000 sec (30 days) as UNIX timestamp
+                       // thus $expiration should be converted from lifetime to UNIX timestamp
+               if ($expiration > 2592000) {
+                       $expiration += $GLOBALS['EXEC_TIME'];
+               }
+
                try {
                        if(strlen($data) > self::MAX_BUCKET_SIZE) {
                                $data = str_split($data, 1024 * 1000);