Mantis - Resin
Viewing Issue Advanced Details
1992 minor sometimes 09-05-07 11:06 10-24-07 10:49
david-peterson  
ferg  
normal  
closed 3.0.19  
fixed  
none    
none 3.0.25  
0001992: files "stuck" in proxy cache
We have noticed that at random occurrences a file will get "stuck" in the cache and even though the file has been updated on disk, the server will continue to send the old version of the file back to the client. This behavior persists long after the <cache-mapping/> directives specify the file to be cached.

It also seems somehow tied to the value of the Host: header. If that header is spoofed to something other than the name of the server the new file will be returned.

Output using wget to show the HTTP headers. The first request gets the old file, the second the new. The only difference is the value of the Host: header. The same thing happens going to the public VIP (www.salesforce.com), but this example goes directly to the real server to show the load balancer isn't somehow causing the problem. The Last-Modified time of the second fetch is the actual modification time on-disk.

$ wget --header="Host: www.salesforce.com" -S -O /dev/null http://public-web2-2-sjl:8085/common/assets/css/images/hdr_sfdc.gif [^]
--10:44:24-- http://public-web2-2-sjl:8085/common/assets/css/images/hdr_sfdc.gif [^]
           => `/dev/null'
Resolving public-web2-2-sjl... 10.227.32.11
Connecting to public-web2-2-sjl|10.227.32.11|:8085... connected.
HTTP request sent, awaiting response...
  HTTP/1.0 200 OK
  Server:
  ETag: "GvG8oten0jA"
  Last-Modified: Thu, 15 Feb 2007 19:52:25 GMT
  Cache-Control: max-age=14400
  Expires: Wed, 05 Sep 2007 21:44:24 GMT
  Content-Type: image/gif
  Content-Length: 7069
  Date: Wed, 05 Sep 2007 17:44:24 GMT
Length: 7,069 (6.9K) [image/gif]

100%[===========================================================================================================================================================>] 7,069 --.--K/s

10:44:24 (4.94 MB/s) - `/dev/null' saved [7069/7069]

$ wget --header="Host: NOT-www.salesforce.com" -S -O /dev/null http://public-web2-2-sjl:8085/common/assets/css/images/hdr_sfdc.gif [^]
--10:44:29-- http://public-web2-2-sjl:8085/common/assets/css/images/hdr_sfdc.gif [^]
           => `/dev/null'
Resolving public-web2-2-sjl... 10.227.32.11
Connecting to public-web2-2-sjl|10.227.32.11|:8085... connected.
HTTP request sent, awaiting response...
  HTTP/1.0 200 OK
  Server:
  ETag: "C/S2FjXqlzG"
  Last-Modified: Wed, 05 Sep 2007 01:29:17 GMT
  Accept-Ranges: bytes
  Cache-Control: max-age=14400
  Expires: Wed, 05 Sep 2007 21:44:28 GMT
  Content-Type: image/gif
  Content-Length: 7903
  Date: Wed, 05 Sep 2007 17:44:28 GMT
Length: 7,903 (7.7K) [image/gif]

100%[===========================================================================================================================================================>] 7,903 --.--K/s

10:44:29 (5.41 MB/s) - `/dev/null' saved [7903/7903]



-------------

Here is the relevant configuration directives:

    <server>
        <cache path="${web.home}/logs/cache"/>


    <web-app-default>
        <cache-mapping url-pattern='*.gif' expires='4h'/>


Notes
(0002268)
david-peterson   
09-05-07 11:09   
Also, here are the corresponding lines from Resin's access log:

10.0.62.86 - - [05/Sep/2007:17:44:24 +0000] "GET /common/assets/css/images/hdr_sfdc.gif HTTP/1.0" 200 7069 "-" "Wget/1.10.2"
10.0.62.86 - - [05/Sep/2007:17:44:28 +0000] "GET /common/assets/css/images/hdr_sfdc.gif HTTP/1.0" 200 7903 "-" "Wget/1.10.2"