You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Pascal Dimassimo <th...@hotmail.com> on 2009/02/20 18:53:37 UTC

Question about etag

Hi guys,
 
I'm having trouble understanding the behavior of firefox and the etag.
 
After cleaning the cache, I send this request from firefox:
 
GET /solr/select/?q=television HTTP/1.1
Host: localhost:8088
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6 (.NET CLR 3.5.30729)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
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
Cookie: JSESSIONID=AA71D602A701BB6287C60083DD6879CD
 
Which solr responds with:
 
HTTP/1.1 200 OK
Last-Modified: Thu, 19 Feb 2009 19:57:14 GMT
ETag: "NmViOTJkMjc1ODgwMDAwMFNvbHI="
Content-Type: text/xml; charset=utf-8
Transfer-Encoding: chunked
Server: Jetty(6.1.3)
(#data following#)
 
So far so good. But then, I press F5 to refresh the page. Now if I understand correctly the way the etag works, firefox should send the request with a "if-none-match" along with the etag and then the server should return a 304 "not modified" code.
 
But what happens is that firefox just don't send anything. In the firebug window, I only see "0 requests". Just to make sure I test with tcpmon and nothing is sent by firefox.
 
Is this making sense? Am I missing something?
 
My solrconfig.xml has this config:


 
 
Thanks!


_________________________________________________________________
The new Windows Live Messenger. You don’t want to miss this.
http://www.microsoft.com/windows/windowslive/products/messenger.aspx

Re: Question about etag

Posted by Pascal Dimassimo <th...@hotmail.com>.
I finally found the reason of this behavior. I realize that if I waited a
couple of minutes, Firefox would send the "if-none-match" header which was
responded by the 304 code by solr.

What happens is that Firefox keeps a disk cache. If a response contains the
header "Last-Modified", even if there is a etag header, Firefox computes an
expiration date which was about 5 minutes for my request. And during that
period, the request was served from the cache. 

You can see the expiration date by looking at about:cache in Firefox. The
rules to compute the expiration time depending on the headers is described
here: https://developer.mozilla.org/En/HTTP_Caching_FAQ

I realize that this was a Firefox issue. Sorry to have disrupt this list.


Pascal Dimassimo wrote:
> 
> Sorry, the xml of the solrconfig.xml was lost. It is
> 
> <httpCaching lastModifiedFrom="openTime" etagSeed="Solr">
> </httpCaching>
> 
> Hi guys,
>  
> I'm having trouble understanding the behavior of firefox and the etag.
>  
> After cleaning the cache, I send this request from firefox:
>  
> GET /solr/select/?q=television HTTP/1.1
> Host: localhost:8088
> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.6)
> Gecko/2009011913 Firefox/3.0.6 (.NET CLR 3.5.30729)
> Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
> 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
> Cookie: JSESSIONID=AA71D602A701BB6287C60083DD6879CD
>  
> Which solr responds with:
>  
> HTTP/1.1 200 OK
> Last-Modified: Thu, 19 Feb 2009 19:57:14 GMT
> ETag: "NmViOTJkMjc1ODgwMDAwMFNvbHI="
> Content-Type: text/xml; charset=utf-8
> Transfer-Encoding: chunked
> Server: Jetty(6.1.3)
> (#data following#)
>  
> So far so good. But then, I press F5 to refresh the page. Now if I
> understand correctly the way the etag works, firefox should send the
> request with a "if-none-match" along with the etag and then the server
> should return a 304 "not modified" code.
>  
> But what happens is that firefox just don't send anything. In the firebug
> window, I only see "0 requests". Just to make sure I test with tcpmon and
> nothing is sent by firefox.
>  
> Is this making sense? Am I missing something?
>  
> My solrconfig.xml has this config:
> 
> 
>  
>  
> Thanks!
> 
> 

-- 
View this message in context: http://www.nabble.com/Question-about-etag-tp22125449p22167528.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Question about etag

Posted by Pascal Dimassimo <th...@hotmail.com>.
Sorry, the xml of the solrconfig.xml was lost. It is

<httpCaching lastModifiedFrom="openTime" etagSeed="Solr">
</httpCaching>



Hi guys,
 
I'm having trouble understanding the behavior of firefox and the etag.
 
After cleaning the cache, I send this request from firefox:
 
GET /solr/select/?q=television HTTP/1.1
Host: localhost:8088
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.6)
Gecko/2009011913 Firefox/3.0.6 (.NET CLR 3.5.30729)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
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
Cookie: JSESSIONID=AA71D602A701BB6287C60083DD6879CD
 
Which solr responds with:
 
HTTP/1.1 200 OK
Last-Modified: Thu, 19 Feb 2009 19:57:14 GMT
ETag: "NmViOTJkMjc1ODgwMDAwMFNvbHI="
Content-Type: text/xml; charset=utf-8
Transfer-Encoding: chunked
Server: Jetty(6.1.3)
(#data following#)
 
So far so good. But then, I press F5 to refresh the page. Now if I
understand correctly the way the etag works, firefox should send the request
with a "if-none-match" along with the etag and then the server should return
a 304 "not modified" code.
 
But what happens is that firefox just don't send anything. In the firebug
window, I only see "0 requests". Just to make sure I test with tcpmon and
nothing is sent by firefox.
 
Is this making sense? Am I missing something?
 
My solrconfig.xml has this config:


 
 
Thanks!

-- 
View this message in context: http://www.nabble.com/Question-about-etag-tp22125449p22127322.html
Sent from the Solr - User mailing list archive at Nabble.com.