Fixed bug #17167: Cache ExtDirect::getAPI calls
authorSteffen Gebert <steffen.gebert@typo3.org>
Thu, 20 Jan 2011 23:49:00 +0000 (23:49 +0000)
committerSteffen Gebert <steffen.gebert@typo3.org>
Thu, 20 Jan 2011 23:49:00 +0000 (23:49 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@10185 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/extjs/class.t3lib_extjs_extdirectapi.php
typo3/backend.php
typo3/classes/class.livesearch.php
typo3/sysext/em/classes/class.tx_em_extensionmanager.php
typo3/template.php

index 81e6ce6..63f1818 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-01-21  Steffen Gebert  <steffen@steffen-gebert.de>
+
+       * Fixed bug #17167: Cache ExtDirect::getAPI calls
+
 2011-01-21  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Fixed bug #17140: htmlArea RTE: In WebKit, RTE inserts incorrect link if text is double-clicked
index 193c92b..ad5efea 100644 (file)
@@ -93,6 +93,12 @@ class t3lib_extjs_ExtDirectApi {
                        $javascriptNamespaces = unserialize($cacheContent);
                }
 
+                       // enable caching
+               $expireDate = date('r', $GLOBALS['EXEC_TIME'] + 3600 * 24 * 30);
+               header('Expires: ' . $expireDate);
+               header('Cache-control: public');
+               header('Pragma:');
+
                        // return the generated javascript API configuration
                if (count($javascriptNamespaces)) {
                        $setup = '
index c2f9cad..43f89a1 100644 (file)
@@ -249,12 +249,12 @@ class TYPO3backend {
                if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect'])) {
                        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect'] as $key => $value) {
                                if (strpos($key, 'TYPO3.Ajax.ExtDirect') !== FALSE) {
-                                       $this->pageRenderer->addJsFile('ajax.php?ajaxID=ExtDirect::getAPI&namespace=TYPO3.Ajax.ExtDirect', NULL, FALSE);
+                                       $this->pageRenderer->addJsFile('ajax.php?ajaxID=ExtDirect::getAPI&namespace=TYPO3.Ajax.ExtDirect&' . TYPO3_version, NULL, FALSE);
                                        break;
                                }
                        }
                }
-               $this->pageRenderer->addJsFile('ajax.php?ajaxID=ExtDirect::getAPI&namespace=TYPO3.BackendUserSettings', NULL, FALSE);
+               $this->pageRenderer->addJsFile('ajax.php?ajaxID=ExtDirect::getAPI&namespace=TYPO3.BackendUserSettings&' . TYPO3_version, NULL, FALSE);
 
                $this->generateJavascript();
                $this->pageRenderer->addJsInlineCode('BackendInlineJavascript', $this->js);
@@ -349,7 +349,7 @@ class TYPO3backend {
                        if (is_array($info['extDirectNamespaces']) && count($info['extDirectNamespaces'])) {
                                foreach ($info['extDirectNamespaces'] as $namespace) {
                                        $this->pageRenderer->addJsFile(
-                                               'ajax.php?ajaxID=ExtDirect::getAPI&namespace=' . $namespace,
+                                               'ajax.php?ajaxID=ExtDirect::getAPI&namespace=' . $namespace . '&' . TYPO3_version,
                                                NULL,
                                                FALSE
                                        );
index a15d590..f51b4be 100644 (file)
@@ -82,7 +82,7 @@ class LiveSearch implements backend_toolbarItem {
         */
        protected function addJavascriptToBackend() {
                $pageRenderer = $GLOBALS['TBE_TEMPLATE']->getPageRenderer();
-               $pageRenderer->addJsFile('ajax.php?ajaxID=ExtDirect::getAPI&namespace=TYPO3.LiveSearchActions', 'text/javascript', $compress = FALSE);
+               $pageRenderer->addJsFile('ajax.php?ajaxID=ExtDirect::getAPI&namespace=TYPO3.LiveSearchActions&' . TYPO3_version, 'text/javascript', $compress = FALSE);
 
                $this->backendReference->addJavascriptFile('js/livesearch.js');
        }
index e07d6b3..978ce4c 100644 (file)
@@ -132,12 +132,12 @@ class tx_em_ExtensionManager {
 
                        // Load  JavaScript:
                $this->pageRenderer->addJsFile($this->parentObject->doc->backPath .
-                       'ajax.php?ajaxID=ExtDirect::getAPI&namespace=TYPO3.EM',
+                       'ajax.php?ajaxID=ExtDirect::getAPI&namespace=TYPO3.EM&' . TYPO3_version,
                        NULL,
                        FALSE
                );
                $this->pageRenderer->addJsFile($this->parentObject->doc->backPath .
-                       'ajax.php?ajaxID=ExtDirect::getAPI&namespace=TYPO3.EMSOAP',
+                       'ajax.php?ajaxID=ExtDirect::getAPI&namespace=TYPO3.EMSOAP&' . TYPO3_version,
                        NULL,
                        FALSE
                );
index d63efea..d76a8b3 100644 (file)
@@ -823,7 +823,7 @@ class template {
 
           if ($this->extDirectStateProvider) {
                        $this->pageRenderer->addJsFile(
-                               $this->backPath . 'ajax.php?ajaxID=ExtDirect::getAPI&namespace=TYPO3.ExtDirectStateProvider',
+                               $this->backPath . 'ajax.php?ajaxID=ExtDirect::getAPI&namespace=TYPO3.ExtDirectStateProvider&' . TYPO3_version,
                                NULL,
                                FALSE
                        );
@@ -1639,7 +1639,7 @@ $str.=$this->docBodyTagBegin().
        protected function loadCshJavascript() {
                $this->pageRenderer->loadExtJS();
                $this->pageRenderer->addJsFile($this->backPath .'../t3lib/js/extjs/contexthelp.js');
-               $this->pageRenderer->addJsFile($this->backPath . 'ajax.php?ajaxID=ExtDirect::getAPI&namespace=TYPO3.CSH', NULL, FALSE);
+               $this->pageRenderer->addJsFile($this->backPath . 'ajax.php?ajaxID=ExtDirect::getAPI&namespace=TYPO3.CSH&' . TYPO3_version, NULL, FALSE);
                $this->pageRenderer->addExtDirectCode();
        }