Will squid cache the response from a origin server if the server does
NOT send a Last-Modified header or a max-age ( greater than 0) header?
Looking at the code below, I see that it needs the last modified header.
Is that true ? Am I looking at the right place ?
refreshIsCachable(const StoreEntry * entry)
{
/*
* Don't look at the request to avoid no-cache and other nuisances.
* the object should have a mem_obj so the URL will be found there.
* 60 seconds delta, to avoid objects which expire almost
* immediately, and which can't be refreshed.
*/
int reason = refreshCheck(entry, NULL, Config.minimum_expiry_time);
refreshCounts[rcStore].total++;
refreshCounts[rcStore].status[reason]++;
if (reason < 200)
/* Does not need refresh. This is certainly cachable */
return 1;
if (entry->lastmod < 0)
{
debug(22, 9) ("Mohan:refreshCheck: %d\n",entry->lastmod);
/* Last modified is needed to do a refresh */
return 0;
}
if (entry->mem_obj == NULL)
/* no mem_obj? */
return 1;
if (entry->mem_obj->reply == NULL)
/* no reply? */
return 1;
if (entry->mem_obj->reply->content_length == 0)
/* No use refreshing (caching?) 0 byte objects */
return 0;
/* This seems to be refreshable. Cache it */
return 1;
}
-- ------------------------------------------ Mohan Rao (650 937 3369) / mohansrao@aol.com AIM : mohansrao MBA at Santa Clara University ------------------------------------------Received on Tue Nov 28 2006 - 13:10:23 MST
This archive was generated by hypermail pre-2.1.9 : Fri Dec 01 2006 - 12:00:03 MST