[FEATURE] Enable Content-length header in FE by default 43/21243/8
authorDmitry Dulepov <dmitry.dulepov@gmail.com>
Wed, 5 Jun 2013 13:52:27 +0000 (16:52 +0300)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 10 Oct 2013 17:54:51 +0000 (19:54 +0200)
Enabling Content-length header speeds up rendering if pipelining
is enabled in Apache (browser does not have to wait for further
data).

Change-Id: Id6212d0db60732aca035c87e6686711f53eb6fd8
Resolves: #19732
Releases: 6.2
Reviewed-on: https://review.typo3.org/21243
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Thorsten Kahler
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
NEWS.txt
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

index 7191a4e..4a5d3ba 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -73,6 +73,11 @@ result: '0, 22, 11, 4'
 Administration / Customization
 -------------------------------------------------------------------------------
 
+* Content-length Header is now enabled by default
+
+The TypoScript setting config.enableContentLengthHeader has a new default
+value and is now enabled by default.
+
 -------------------------------------------------------------------------------
 Extbase
 -------------------------------------------------------------------------------
index d12f57f..13951f7 100644 (file)
@@ -3671,8 +3671,14 @@ if (version == "n3") {
                        }
                }
                // Send content-lenght header.
-               // Notice that all HTML content outside the length of the content-length header will be cut off! Therefore content of unknown length from included PHP-scripts and if admin users are logged in (admin panel might show...) or if debug mode is turned on, we disable it!
-               if (!empty($this->config['config']['enableContentLengthHeader']) && !$this->beUserLogin && !$this->TYPO3_CONF_VARS['FE']['debug'] && !$this->config['config']['debug'] && !$this->doWorkspacePreview()) {
+               // Notice that all HTML content outside the length of the content-length header will be cut off!
+               // Therefore content of unknown length from included PHP-scripts and if admin users are logged
+               // in (admin panel might show...) or if debug mode is turned on, we disable it!
+               if (
+                       (!isset($this->config['config']['enableContentLengthHeader']) || $this->config['config']['enableContentLengthHeader'])
+                       && !$this->beUserLogin && !$this->TYPO3_CONF_VARS['FE']['debug']
+                       && !$this->config['config']['debug'] && !$this->doWorkspacePreview()
+               ) {
                        header('Content-Length: ' . strlen($this->content));
                }
        }