[!!!][BUGFIX] Avoid unnecessary de-/serialization for page cache 79/27179/5
authorBernhard Kraft <kraft@webconsulting.at>
Fri, 31 Jan 2014 08:56:50 +0000 (09:56 +0100)
committerAndreas Wolf <andreas.wolf@typo3.org>
Sat, 1 Feb 2014 12:49:16 +0000 (13:49 +0100)
When storing a cache in page the array variable "cache_data" gets
serialized and when being retrieved from cache unserialized.

This is not necessary as de-/serialization is already performed by
the variable caching backend.

Change-Id: I9cf817123947af3f4076dabdce3c569bf41b477c
Resolves: #55493
Releases: 6.2
Reviewed-on: https://review.typo3.org/27179
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Andreas Wolf
Tested-by: Andreas Wolf
NEWS.md
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

diff --git a/NEWS.md b/NEWS.md
index 4da0999..70b85b1 100644 (file)
--- a/NEWS.md
+++ b/NEWS.md
@@ -141,6 +141,10 @@ incomplete HTML when a frontend page is rendered was removed from the TYPO3
 Core. Its functionality is now provided by the TER extension "Tidy".
 The extension works with the same options as before.
 
+* Change in Hook TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['pageLoadedFromCache']
+
+Previously $row['cache_data'] was a serialized array. To avoid double serializing and unserializing,
+from now on $row['cache_data'] is just reconstituted as array when fetching from cache.
 
 ### Administration / Customization
 
@@ -187,4 +191,4 @@ Pages and content elements are now categorizable by default.
 * New menu types
 
 The "Special Menus" content element type now offers the possibility to display
-a list of categorized pages or content elements.
+a list of categorized pages or content elements.
\ No newline at end of file
index d8ca484..18c1eb4 100644 (file)
@@ -2223,7 +2223,7 @@ class TypoScriptFrontendController {
                                                }
                                        }
                                        // Fetches the lowlevel config stored with the cached data
-                                       $this->config = (array) unserialize($row['cache_data']);
+                                       $this->config = $row['cache_data'];
                                        // Getting the content
                                        $this->content = $row['content'];
                                        // Flag for temp content
@@ -3144,7 +3144,7 @@ class TypoScriptFrontendController {
                        'page_id' => $this->id,
                        'content' => $content,
                        'temp_content' => $this->tempContent,
-                       'cache_data' => serialize($data),
+                       'cache_data' => $data,
                        'expires' => $expirationTstamp,
                        'tstamp' => $GLOBALS['EXEC_TIME']
                );