[TASK] Disable compression for inlineJs in Backend
authorSteffen Gebert <steffen.gebert@typo3.org>
Tue, 9 Aug 2011 19:51:32 +0000 (21:51 +0200)
committerHelmut Hummel <typo3@helmut-hummel.de>
Sat, 10 Sep 2011 16:56:05 +0000 (18:56 +0200)
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: I5623ad6c8b9d24777b6bcf46ea97bf51eb9c62d3
Resolves: #29498
Reviewed-on: http://review.typo3.org/4778
Reviewed-by: Xavier Perseguers
Reviewed-by: Björn Pedersen
Tested-by: Björn Pedersen
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
t3lib/class.t3lib_pagerenderer.php
typo3/backend.php
typo3/sysext/cms/layout/wizard_backend_layout.php
typo3/template.php

index 4154163..d7377a0 100644 (file)
@@ -1074,7 +1074,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 bb979ac..889aa60 100644 (file)
@@ -104,7 +104,8 @@ class TYPO3backend {
 
                $this->pageRenderer->addJsInlineCode(
                        'consoleOverrideWithDebugPanel',
-                       '//already done'
+                       '//already done',
+                       FALSE
                );
                $this->pageRenderer->addExtDirectCode();
 
@@ -239,7 +240,7 @@ class TYPO3backend {
 
 
                $this->generateJavascript();
-               $this->pageRenderer->addJsInlineCode('BackendInlineJavascript', $this->js);
+               $this->pageRenderer->addJsInlineCode('BackendInlineJavascript', $this->js, FALSE);
 
                $this->loadResourcesForRegisteredNavigationComponents();
 
index 50deb9a..0848437 100644 (file)
@@ -84,7 +84,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 d3934e7..935c3fa 100644 (file)
@@ -754,12 +754,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)) {
@@ -2178,7 +2180,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);
                        }
                }
        }