[Laszlo-dev] Expires header from LPS server

P T Withington ptw at openlaszlo.org
Fri Nov 17 09:32:17 PST 2006


Should we be using the more modern [cache-control](http:// 
www.mnot.net/cache_docs/#CACHE-CONTROL), in particular to mark the  
LFC as publicly cacheable?  Are there any clients out there any more  
that do not use HTTP 1.1?

On 2006-11-16, at 23:12 EST, Henry Minsky wrote:

> Hmm, I needed to add code to the LFC responder to check the last  
> modified
> header. I believe I have a patch
> now that doesn't reload the lfc or app code unneccessarily.
> I'll send a patch for review.
>
> I'm using Fiddler to watch the HTTP traffic..
>
> On 11/16/06, Henry Minsky <henry.minsky at gmail.com> wrote:
>>
>> I'm looking at http://www.openlaszlo.org/jira/browse/LPP-3053
>> "Server sending expires headers which prevent javascript from  
>> caching"
>>
>> And I see this code in  LzServlet that generates an Expires header:
>>
>>
>>     public void doGet(HttpServletRequest req, HttpServletResponse  
>> res)
>>         throws IOException, ServletException
>>     {
>>         // If no encoding is specified, force it. Note that  
>> encoding has
>> to be
>>         // set before request parameters are accessed.
>>         if (req.getCharacterEncoding() == null) {
>>             req.setCharacterEncoding(mCharacterEncoding);
>>         }
>>
>>         // This forces clients to talk to us. We may still return
>> NOT_MODIFIED.
>>         // TODO: [bloch 2002-12-17] turn this into an lps.property
>>         if (! isMacIE(req) ) { // Set only if it's not Mac IE 5.2  
>> (see bug
>> 811)
>>             res.setHeader("Expires", "Fri, 05 Oct 2001 00:00:00  
>> GMT");
>>         }
>>
>>
>> The implication is that even if the Expires dates has passed, the  
>> client
>> will respect
>> the NOT_MODIFIED return code (which is being returned by the  
>> server) and
>> not request a reload
>> of the page. The Firefox LiveHTTPHeaders trace looks like this
>>
>> http://localhost:8080/legals/test/lpp-2976.lzx? 
>> lzt=object&lzr=dhtml&_canvas_debug=false
>>
>>
>> GET /legals/test/lpp-2976.lzx? 
>> lzt=object&lzr=dhtml&_canvas_debug=false
>> HTTP/1.1
>> Host: localhost:8080
>> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1)
>> Gecko/20061010 Firefox/2.0
>> Accept: */*
>> Accept-Language: en-us,en;q=0.5
>> Accept-Encoding: gzip,deflate
>> Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
>> Keep-Alive: 300
>> Connection: keep-alive
>> Referer: http://localhost:8080/legals/test/lpp-2976.lzx? 
>> lzr=dhtml&lzt=html
>> Cookie: JSESSIONID=53EFE301BDBF944484A05A39E7EBDAA2;
>> PHPSESSID=d3f2225533a1b1d7eb6acc0c6e023edb
>> If-Modified-Since: Fri, 17 Nov 2006 03:22:35 GMT
>> Cache-Control: max-age=0
>>
>> HTTP/1.x 304 Not Modified
>> Expires: Fri, 05 Oct 2001 00:00:00 GMT
>> Date: Fri, 17 Nov 2006 03:27:47 GMT
>> Server: Apache-Coyote/1.1
>>
>>
>> It appears that the page is not being resent, so maybe this isn't  
>> a bug
>> after all?
>>
>> Maybe I'd better install a proxy monitor tool and see what bits are
>> actually flowing..
>>
>>
>>
>> --
>> Henry Minsky
>> Software Architect
>> hminsky at laszlosystems.com
>>
>>
>>
>
>
> -- 
> Henry Minsky
> Software Architect
> hminsky at laszlosystems.com



More information about the Laszlo-dev mailing list