[TYPO3-core] RFC: Bugfix #10212: Missing files in sysext install

Steffen Müller typo3 at t3node.com
Tue Feb 17 17:31:15 CET 2009


Hi.

On 17.02.2009 16:56 Marcus Krause wrote:
> 
> The trunk encryption key polling is different from that in the branches.
> I'm not sure if it does matter at all for the cache thing, but the trunk
> one evaluates cmd-parameter before whereas the branches are always
> sending encryption key.
> By that, in trunk the class can handle further ajax calls.
> 

Thanks for clarification.

> 
> As I said, I'd stay at the GET request and would rather see proper cache
> control headers set in the AJAX class.
> 

Something like the above example? It works on IE. But once again unsure
about this solution, since I'm not familiar with processing of eiD. Is
there a commen place, where HTTP header are set for eiD scripts?


Index: class.tx_install_ajax.php
===================================================================
--- class.tx_install_ajax.php	(revision 5024)
+++ class.tx_install_ajax.php	(working copy)
@@ -94,7 +94,7 @@
 		switch ($this->cmd) {
 			case 'encryptionKey':
 			default:
-				$this->content = $this->createEncryptionKey();
+				$this->content = $this->createCachingHeaders().
$this->createEncryptionKey();
 				break;
 		}
 	}
@@ -119,6 +119,18 @@
 		$bytes = t3lib_div::generateRandomBytes($keyLength);
 		return substr(bin2hex($bytes), -96);
 	}
+
+	/**
+	 * Generates HTTP caching headers to avoid browser caching
+	 *
+	 * @return	void
+	 */
+	function createCachingHeaders()	{
+		header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
+		header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . 'GMT');
+		header('Cache-Control: no-cache, must-revalidate');
+		header('Pragma: no-cache');
+	}
 }

 // Make instance:

-- 
cheers,
Steffen

http://www.t3node.com/


More information about the TYPO3-team-core mailing list