Re: [SMARTY-DEV] Making Smarty's cache HTTP header aware

From: Date: Thu, 08 Nov 2007 19:26:20 +0000
Subject: Re: [SMARTY-DEV] Making Smarty's cache HTTP header aware
References: 1 2  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-3061@lists.php.net to get a copy of this message
On Nov 8, 2007 2:06 PM, boots <jayboots@yahoo.com> wrote: [snip] > > That said, Luke, can you give more detail on why this is important? Thanks! Sure, I'd be happy to. The particular case that I ran into had to do with enabling client-side caching using the Cache-Control HTTP header. In my PHP code, I used something like the following: header("Cache-Control: max-age=21600, public"); That header call was in PHP code that only gets run when the smarty cache does not already exist. Therefore, when there is no cached file for this request, that header() gets called along with additional PHP code. However, any subsequent requests will be served from the Smarty cache, which returns only the content that I had sent previously, but not the headers. Without my patch, Smarty simply caches the content of the HTTP response. In most cases this is sufficient. However, the HTTP headers _and_ the content are what define an HTTP response, not just the content. My patch adds caching of the HTTP headers used in the response alongside the content. Thanks, Luke Baker

« previous php.smarty.dev (#3061) next »