Hi, On Fri, Jun 6, 2008 at 12:30 AM, Henrik Nordstrom <henrik@xxxxxxxxxxxxxxxxxxx> wrote: > On tor, 2008-06-05 at 23:53 +0800, howard chen wrote: > >> 1. I found that if a file only has LM being sent out, the browser >> seems to cache the file forever and won't request the server until you >> press F5, is it true? > > Browser caches is quite often very agressive and only checks for > modification once per browsing session. > E.g. http://www.uwants.com/images/home/title_forum.jpg Which only contains LM, ETAG but not Expire (I think it is Apache default setup) I use FF 2.0 and LiveHTTP header to view the req/response, and after I got the file for the first time, my FF will not issue the second time, even if I close my browser. If I press F5, then 200 is received. >> 2. Squid will not cache for a file if expire has not been set, is it true? > > False. If there is no freshness assigned to the object Squid uses > refresh_pattern to calculate one basedon Last-Modified. > Since the default Squid conf do not have refresh_pattern being set, so squid will NOT cache file if only contains LM but missing Expire or Max-Age? >> 3. The prioiry of client sending cache-control, max-age=0 is higher >> than IMS and must force contacting the backend to refresh (i.e. not >> 304 but 200). > > max-age=0 instructs caches to query the next hop to verify freshness > using a conditional query (i.e. If-Modified-Since). Which means thata > GET with max-age=0 will be transformed into an If-Modified-Since query > by Squid if the object is cached. > So far, my main problem, my squid never use IMS to call my apache, if I request a file with max-age=0, the squid will always get from my apache, which in turn my apache return 200 to squid [not 304], and squid also return 200 to my client. I am not sure if squid provided IMS, but my client do send IMS to squid. (I don't have settings such as refresh_all_ims or reload_into_ims or refresh_platten ) Thank very much for your help. Howard