This might be a FAQ but I'm willing to take a chance. In class ImageFile (from App/ImageFile.py) the following headers are set when you view an ImageFile object: <pseudocode> 'Content-Type': self.content_type 'Last-Modified': self.lmh # RFC1123 'Cache-Control': 'public,max-age=3600' </pseudocode> What is the difference between 'Cache-Control' and 'Expires'? What is best to use and for what? I no longer know exactly why but in all my stylesheet DTML methods I set 'Expires': (DateTime()+10/24.0).rfc822() # 10 hours but not the 'Cache-Control'. Should I use both? -- Peter Bengtsson, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.com
Peter Bengtsson wrote at 2005-9-8 17:23 +0100:
... What is the difference between 'Cache-Control' and 'Expires'?
Cache control is the modern (HTTP 1.1) way, "Expires" the old (HTTP 1.0) one.
What is best to use and for what?
Use them both: HTTP 1.1 clients will honour "Cache-Control" (which is easier to use and much more flexible). HTTP 1.0 clients will ignore "Cache-Control" but honour "Expires". With "Expires" you get thus at least a bit control for these old clients. -- Dieter
participants (2)
-
Dieter Maurer -
Peter Bengtsson