[squid-users] 302 response becomes not cacheable with "if-modified-since" header?

From: Chris Fong <Chris.Fong@dont-contact.us>
Date: Mon, 10 Oct 2005 20:09:25 -0700

Hi,

I am currently using squid 2.5.STABLE9. I noticed that if my request has the "if-modified-since" header, server's 302 response becomes no longer cacheable. However, if I take out that header, the 302 response becomes cacheable again. However, if the response is 200 instead of 302, even with "if-modified-since" header, the response is still cacheable. I can't find anywhere in the specs specifying the above behavior. Also, I notice the code is doing it intentionally (only 200 is cacheable). Am I missing something?

    /*
     * Handle If-Modified-Since requests from the client
     */
    if (mem->reply->sline.status != HTTP_OK) {
        debug(33, 4) ("clientCacheHit: Reply code %d != 200\n",
        mem->reply->sline.status);
        memFree(buf, MEM_CLIENT_SOCK_BUF);
        http->log_type = LOG_TCP_MISS;
        clientProcessMiss(http);
    }

I would like to find a way to cache those 302 response even if the requests have "if-modified-since" header. Any suggestion?

Thanks,

--Chris
Received on Mon Oct 10 2005 - 21:09:26 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Nov 01 2005 - 12:00:04 MST