Re: can I remove cache feature from Squid or how can I make the time of cache is very short

From: Amos Jeffries <squid3@dont-contact.us>
Date: Mon, 1 Oct 2007 09:28:03 +1300 (NZDT)

>
> Hi Amos
>
> Thank you for your reply. I believe this is good solution.
> But after I made the change below in my custom web page:
>
> snprintf(buf, 128, "X-Infection-Found: Type=0; Resolution=2;
> Threat=URL;");
> buf[127] = '\0';
> ci_request_add_xheader(req, buf);
> snprintf(buf, 128, "Cache-Control:
> cache-request-directive=no-cache;cache-response-directive=no-cache;");
> // i tested snprintf(buf, 128, "Cache-Control:
> //cache-request-directive='no-cache';cache-response-directive='no-cache';");
> also.

Ah, it looks like you are slightly misunderstanding the BNF descriptions
in the RFC. Only text bounded by "" is meant as exact. The rest is BNF
syntax and 'variables'.

So 'cache-request-directive' and 'cache-response-directive' are not meant
to be actually in the header.

That should be:
  "Cache-Control: no-cache;"

probably "Cache-Control: no-cache max-age=1 no-store;" to cover all the
bases.

> buf[127] = '\0';
> ci_request_add_xheader(req, buf);
> snprintf(buf, 128, "Expires: -1;");
> buf[127] = '\0';
> ci_request_add_xheader(req, buf);
>
> my custom web page is still kept displaying . Any comments?
>

Apparently "Expires: -1;" is invalid. Better to use an explicit timestamp,
even if its Jan 1970, just to be sure that it works as expected.

Keep in mind. The changes you make will always only be visible after the
previously bad version has been dropped from cache.

Amos
Received on Sun Sep 30 2007 - 14:28:25 MDT

This archive was generated by hypermail pre-2.1.9 : Mon Oct 01 2007 - 12:00:05 MDT