Re: Querystring vs. Squid Cacheserver

From: Andreas J. Koenig <andreas.koenig@dont-contact.us>
Date: 02 Mar 1999 14:33:53 +0100

>>>>> On Tue, 02 Mar 1999 12:22:22 +0100, Ole Moller <olm@cybercity.dk> said:

> I still dont see the point. The issue is whether or not the script gives
> the same output given the same input at a later point in time. Even though
> you are right that words like 'sex' tends to be often used when querying
> search-engines, there are no way a cache can know that the output wont be
> changed due to adding or deleting of urls in the database, conditioning
> formatting of output depending on the browser used and so on.

> Since this is the case in 99% of the urls including a question mark I will
> keep my squid.conf as it is - rather than pollution my cache with 99% junk
> just to respect (your) 1% cache-friendly urls.

I will no longer try to convince you, because most probably you are
right for 99% of the dirty CGI programs out there. But maybe you are
not, because 99% of the CGI programmers do not know how to write a
meaningful Last-Modified and Expires header.

I have realized that I'm in the classical statistical discrimination
situation and I have to masquerade to get out if it.

> I would suggest [...suggestions how to remedy my situation left out...]

Thanks for the suggestions, but my first posting was already a pretty
complete solution to the problem from my point of view. Please let me
repeat (this is a mod_perl PerlPostReadRequestHandler):

  sub handler {
    my($r) = @_;
    my $uri = $r->uri;
    if ( $uri !~ /\?/ && $uri =~ /(.+?);(.*)/ ) {
      my($u1,$u2) = ($1, $2);
      $u2 =~ s/\.htm//;
      $r->uri($u1);
      $r->args($u2);
    }
    DECLINED;
  }

This snippet replaces the first semicolon in a Non-Query with a
question mark and turns it into a query for the next handler. Problem
solved.

> Before you do that I still think that you should consider what the
> likelihood is that the same 'page' will be shown twice within your
> expire-time. If it is unlikely I dont think it is cache-friendly to make
> every cache in the world cache a copy of your 'page' just because it is
> possible.

Good point. But that's a job a good cache server has to do in general.
I have a few tiles that are served several million times per year. A
good cache server should have them. BTW, if you're interested in the
server, it is http://www.stadtplandienst.de.

Thanks for your interest,

-- 
andreas
Received on Tue Mar 02 1999 - 06:47:37 MST

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