RE: Expires: header prevents caching
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On > Behalf Of Greg Ames > and yes, HTTP version does make a difference: Yes, you are right. My test was flawed. Everything seems to be working properly. Joshua.
Re: Expires: header prevents caching
Joshua Slive wrote: > I'm no protcol expert, but that doesn't make sense to me. mod_negotiation > should be adding "Accept-Language" to the Vary: header (yep, it's doing > that), but it shouldn't be setting Expires, should it? Proxies should be > free to cache the page, conditional on the Accept-Language. Here's the chunk of code from mod_negotiation: if ((!do_cache_negotiated_docs(r->server) && (r->proto_num < HTTP_VERSION(1,1))) && neg->count_multiviews_variants != 1) { r->no_cache = 1; } and yes, HTTP version does make a difference: [gregames@gandalf gregames]$ runsocks nc httpd.apache.org 80 HEAD /docs/mod/core.html HTTP/1.1 host: httpd.apache.org HTTP/1.1 200 OK Date: Tue, 22 Jan 2002 19:46:47 GMT Server: Apache/2.0.29 (Unix) Content-Location: core.html.en Vary: negotiate,accept-language TCN: choice Accept-Ranges: bytes Content-Type: text/html Content-Language: en for comparison purposes: [gregames@gandalf gregames]$ runsocks nc httpd.apache.org 80 HEAD /docs/mod/core.html HTTP/1.0 host: httpd.apache.org HTTP/1.1 200 OK Date: Tue, 22 Jan 2002 19:49:07 GMT Server: Apache/2.0.29 (Unix) Content-Location: core.html.en Vary: negotiate,accept-language TCN: choice Accept-Ranges: bytes Connection: close Content-Type: text/html Content-Language: en Expires: Tue, 22 Jan 2002 19:49:07 GMT ...so Andrzej's squid must be using HTTP/1.0 Greg
RE: Expires: header prevents caching
> From: William A. Rowe, Jr. [mailto:[EMAIL PROTECTED]] > > I'm no protcol expert, but that doesn't make sense to me. > mod_negotiation > > should be adding "Accept-Language" to the Vary: header (yep, it's doing > > that), but it shouldn't be setting Expires, should it? Proxies > should be > > free to cache the page, conditional on the Accept-Language. > > Which proxies? > > HTTP/1.1 proxies, yes, should be able to serve based on Vary: recognition. > > HTTP/1.0 proxies, no, cannot do that. We should add [if it's not already > present] the appropriate conditions in that reset. > Yes, you're right. But at the moment, we are getting Expires for ALL requests. That's not good, in my opinion. That will prevent even HTTP/1.1 clients/proxies from caching. Joshua.
Re: Expires: header prevents caching
From: "Joshua Slive" <[EMAIL PROTECTED]> Sent: Tuesday, January 22, 2002 1:32 PM > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On > > Behalf Of Greg Ames > > > OK, I see what's happening: > > > > [gregames@daedalus apache]$ ls /www/httpd.apache.org/docs/mod/core* > > /www/httpd.apache.org/docs/mod/core.html.en > > /www/httpd.apache.org/docs/mod/core.html.fr > > /www/httpd.apache.org/docs/mod/core.html.html > > > > mod_negotiation is turning off caching because there are multiple > > versions of > > that document. We wouldn't want squid to cache an English version of the > > document and serve it to a French client. > > I'm no protcol expert, but that doesn't make sense to me. mod_negotiation > should be adding "Accept-Language" to the Vary: header (yep, it's doing > that), but it shouldn't be setting Expires, should it? Proxies should be > free to cache the page, conditional on the Accept-Language. Which proxies? HTTP/1.1 proxies, yes, should be able to serve based on Vary: recognition. HTTP/1.0 proxies, no, cannot do that. We should add [if it's not already present] the appropriate conditions in that reset.
RE: Expires: header prevents caching
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On > Behalf Of Greg Ames > OK, I see what's happening: > > [gregames@daedalus apache]$ ls /www/httpd.apache.org/docs/mod/core* > /www/httpd.apache.org/docs/mod/core.html.en > /www/httpd.apache.org/docs/mod/core.html.fr > /www/httpd.apache.org/docs/mod/core.html.html > > mod_negotiation is turning off caching because there are multiple > versions of > that document. We wouldn't want squid to cache an English version of the > document and serve it to a French client. I'm no protcol expert, but that doesn't make sense to me. mod_negotiation should be adding "Accept-Language" to the Vary: header (yep, it's doing that), but it shouldn't be setting Expires, should it? Proxies should be free to cache the page, conditional on the Accept-Language. Joshua.
Re: Expires: header prevents caching
Greg Ames wrote: > > I tested the URL that Andrzej mentions below. Sho 'nuf, the value of the > Expires: headers we send is exactly the same as the value of the Date: header. > RFC 2616 says the content can't be cached by proxies in this case. OK, I see what's happening: [gregames@daedalus apache]$ ls /www/httpd.apache.org/docs/mod/core* /www/httpd.apache.org/docs/mod/core.html.en /www/httpd.apache.org/docs/mod/core.html.fr /www/httpd.apache.org/docs/mod/core.html.html mod_negotiation is turning off caching because there are multiple versions of that document. We wouldn't want squid to cache an English version of the document and serve it to a French client. Greg > -- Forwarded message -- > Date: Mon, 21 Jan 2002 12:55:17 +0100 > From: Andrzej Kukula <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject: Two things > > Hello. > > 2. (Far more important) httpd.apache.org transmits the same Date: and > Expires: HTTP headers, thus making squid unable to cache your pages. I've > tested it with httpd.apache.org/docs/mod/core.html. > > Regards, > Andrzej KukuĀ³a
Re: Expires: header prevents caching
Greg Ames wrote: > I tested the URL that Andrzej mentions below. Sho 'nuf, the value of the > Expires: headers we send is exactly the same as the value of the Date: header. > RFC 2616 says the content can't be cached by proxies in this case. mod-include (which core.html runs through) removes the 'Last-Modified'/Etag and I think, Expires headers from the page. this is due to it not being able to set these properly. (imaging a dynamic piece of content included at the very end of a file, after the headers have been sent out) does the main webserver use mod-expire? > > [gregames@gandalf gregames]$ runsocks nc httpd.apache.org 80 > HEAD /docs/mod/core.html HTTP/1.0 > host: httpd.apache.org > > HTTP/1.1 200 OK > Date: Tue, 22 Jan 2002 15:34:16 GMT > Server: Apache/2.0.29 (Unix) > Content-Location: core.html.en > Vary: negotiate,accept-language > TCN: choice > Accept-Ranges: bytes > Connection: close > Content-Type: text/html > Content-Language: en > Expires: Tue, 22 Jan 2002 15:34:16 GMT > > but for many other URLs, we don't bother with the Expires: header > > [gregames@gandalf gregames]$ runsocks nc httpd.apache.org 80 > HEAD /index.html HTTP/1.0 > host: httpd.apache.org > > HTTP/1.1 200 OK > Date: Tue, 22 Jan 2002 15:44:37 GMT > Server: Apache/2.0.29 (Unix) > Accept-Ranges: bytes > Content-Length: 6139 > Connection: close > Content-Type: text/html > > Does anyone understand the care and feeding of Expires: headers in Apache? > Seems like it would be in our best interest to allow caching for most/all static > pages. > > Thanks, > Greg > Original Message > Subject: Two things (fwd) > Date: Mon, 21 Jan 2002 09:39:05 -0800 (PST) > From: Brian Behlendorf <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED], <[EMAIL PROTECTED]> > > > Notice the 2nd issue. > > Brian > > -- Forwarded message -- > Date: Mon, 21 Jan 2002 12:55:17 +0100 > From: Andrzej Kukula <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject: Two things > > > Hello. > > I've got just two annoying things: > > 1. On www.apache.org, httpd.apache.org there's no mention on a general > contact concerning the Web Page, so I'm sending this message to well-known > address. > > 2. (Far more important) httpd.apache.org transmits the same Date: and > Expires: HTTP headers, thus making squid unable to cache your pages. I've > tested it with httpd.apache.org/docs/mod/core.html. > > Regards, > Andrzej Kuku? > >