Re: Cannot cache FTP request (HTTP experts advise needed)

From: Robert Collins <robert.collins@dont-contact.us>
Date: Wed, 1 Nov 2000 10:30:57 +1100

----- Original Message -----
From: "Henrik Nordstrom" <hno@hem.passagen.se>
To: "Duane Wessels" <wessels@squid-cache.org>
Cc: <squid-dev@squid-cache.org>
Sent: Wednesday, November 01, 2000 9:50 AM
Subject: Re: Cannot cache FTP request (HTTP experts advise needed)

> Duane Wessels wrote:
>
> > Yeah, we should add a date header.
>
> The RFC actually requires us to add a date header.

is this about right?

Index: HttpReply.c
===================================================================
RCS file: /cvsroot/squid/squid/src/HttpReply.c,v
retrieving revision 1.2
diff -u -r1.2 HttpReply.c
--- HttpReply.c 2000/10/21 15:16:11 1.2
+++ HttpReply.c 2000/10/31 23:24:56
@@ -334,6 +334,8 @@
     const char *str;
     rep->content_length = httpHeaderGetInt(hdr, HDR_CONTENT_LENGTH);
     rep->date = httpHeaderGetTime(hdr, HDR_DATE);
+ if (rep->date==-1)
+ rep->date=squid_curtime;
     rep->last_modified = httpHeaderGetTime(hdr, HDR_LAST_MODIFIED);
     str = httpHeaderGetStr(hdr, HDR_CONTENT_TYPE);
     if (str)

>
> > I have a feeling the special case could be removed because the
> > refreshIsCachable() function takes care of those cases anyway.
>
> Probably true.
>
> The check is pretty old however.. was added in Squid-1.0.1 (http.c
> 1.56.2.40). No explanation except the change log entry saying
>
> - Changed http.c to not save objects from neighbors which do
> not have Date, Last-Modified, or Expires values.
>
> Then some time later there was a temporary workaround to cache non-HTTP
> objects matching the above because of a bug in Squid where no date
> header was send on ftp:// replies..
>
>
> Now back to the problems:
>
> a) Squid does not add a Date header to replies if there is none (at
> least not the current development version)
>
> b) Because of the above and the reasons you outlined earlier, we cannot
> safely kill the check completely. What we can do is to limit the
> requirement to only apply to siblings, and then make sure new versions
> of Squid adds a Date header...
>
> /Henrik
>
>
Received on Tue Oct 31 2000 - 16:25:53 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:12:53 MST