[TASK] Disable compression for inlineJs in Backend
authorSteffen Gebert <steffen.gebert@typo3.org>
Tue, 9 Aug 2011 19:51:32 +0000 (21:51 +0200)
committerGeorg Ringer <mail@ringerge.org>
Wed, 8 Feb 2012 06:44:13 +0000 (07:44 +0100)
JSMin is a major performance nightmare and no network connection can be
as slow as it would justify to spend so much time to execute JSmin
several times for each and every backend request.

As long as we have no fast replacement in core available, disable
compression for all JS snippets added with
t3lib_PageRenderer::addJsInlineCode in the Backend.

JSMin's share of execution time was about 20-25% of the page generation
time, for almost empty backend pages even ~50%.

Change-Id: Iabbd092a349dec6e84c40b7b7c750bc718168d85
Resolves: #29498
Releases: 4.6, 4.5
Reviewed-on: http://review.typo3.org/7201
Reviewed-by: Ernesto Baschny
Tested-by: Ernesto Baschny
Reviewed-by: Sebastian Fischer
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Oliver Klee
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
t3lib/class.t3lib_pagerenderer.php
typo3/backend.php
typo3/sysext/cms/layout/wizard_backend_layout.php
typo3/template.php

index 5a6c059..51dbe1c 100644 (file)
@@ -1005,7 +1005,7 @@ class t3lib_PageRenderer implements t3lib_Singleton {
                $extDirect = t3lib_div::makeInstance('t3lib_extjs_ExtDirectApi');
                $api = $extDirect->getApiPhp($filterNamespaces);
                if ($api) {
-                       $this->addJsInlineCode('TYPO3ExtDirectAPI', $api);
+                       $this->addJsInlineCode('TYPO3ExtDirectAPI', $api, FALSE);
                }
                        // Note: we need to iterate thru the object, because the addProvider method
                        // does this only with multiple arguments
index 3758f30..75c72f3 100644 (file)
@@ -104,7 +104,8 @@ class TYPO3backend {
 
                $this->pageRenderer->addJsInlineCode(
                        'consoleOverrideWithDebugPanel',
-                       '//already done'
+                       '//already done',
+                       FALSE
                );
                $this->pageRenderer->addExtDirectCode();
 
@@ -231,7 +232,7 @@ class TYPO3backend {
 
 
                $this->generateJavascript();
-               $this->pageRenderer->addJsInlineCode('BackendInlineJavascript', $this->js);
+               $this->pageRenderer->addJsInlineCode('BackendInlineJavascript', $this->js, FALSE);
 
                $this->loadResourcesForRegisteredNavigationComponents();
 
index 0aa3aad..6b792e9 100644 (file)
@@ -86,7 +86,9 @@ class SC_wizard_backend_layout {
                                        parent.opener.TBE_EDITOR.fieldChanged("backend_layout","' . $uid . '","config","data[backend_layout][' . $uid . '][config]");
                                }
                        }
-               ');
+                       ',
+                       FALSE
+               );
 
                $languageLabels = array(
                        'save' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_wizards.xml:grid_labelSave', 1),
index f66ba81..d67b98e 100644 (file)
@@ -845,12 +845,14 @@ class template {
                                        }
                                });
                        }
-               ');
+                       ',
+                       FALSE
+               );
 
                $this->pageRenderer->addHeaderData($this->JScode);
 
                foreach ($this->JScodeArray as $name => $code) {
-                       $this->pageRenderer->addJsInlineCode($name, $code);
+                       $this->pageRenderer->addJsInlineCode($name, $code, FALSE);
                }
 
                if (count($this->JScodeLibArray)) {
@@ -2298,7 +2300,7 @@ class frontendDoc extends template {
                }
                if (count($this->JScodeArray)) {
                        foreach ($this->JScodeArray as $name => $code) {
-                               $this->pageRenderer->addJsInlineCode($name, $code);
+                               $this->pageRenderer->addJsInlineCode($name, $code, FALSE);
                        }
                }
        }