Re: Testing with Echoping

From: Henrik Nordstrom <>
Date: Sat, 15 Aug 1998 14:22:21 +0200 wrote:

> This all makes sense so far. My questions for the caching gurus and
> experienced Squid maintainers lurking around here are:
> 1) Can I add something to this line to force a refresh-miss (like
> Shift-Reload in Netscape)
> 2) If so, what?
> 3) Would this provide a more comprehensive automatic test,
> covering not just the cache but also the service beyond it?

Yes, this extends echo-ping to test Squids ability to reach the tested
origin server as well as Squid itself.

You most likely do not want to simulate a shift-reload. A plain reload
suffices and is much less internet traffic. The difference is that a
reload asks the origin server if the object has changed while a
shift-reload fetches the object from the origin server regardless if it
has changed or not.

A forced refresh request (reload in netscape) looks like

GET <url> HTTP/1.0\r\n
If-Modified-Since: <date>\r\n
Pragma: no-cache\r\n

As <date> you can use the current time as in "Sat, 15 Aug 1998 12:09:27
GMT" to minimize the chance that the server replies with the complete

Here is a short excerpt from squid/lib/rfc1123.c that builds a time
string suitable for use in HTTP

#define RFC1123_STRFTIME "%a, %d %b %Y %H:%M:%S GMT"

const char *
mkrfc1123(time_t t)
    static char buf[128];

    struct tm *gmt = gmtime(&t);

    buf[0] = '\0';
    strftime(buf, 127, RFC1123_STRFTIME, gmt);
    return buf;

If you'd like to simulate a forced reload (shift-reload in netscape)
then you only have to add "Pragma: no-cache" to the request, but it
won't give your test a better service coverage.

Henrik Nordström
Sparetime Squid Hacker
Received on Sat Aug 15 1998 - 07:10:17 MDT

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