Re: [squid-users] suggestions on my redirector code

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Mon, 11 Aug 2003 22:50:27 +0200

On Monday 11 August 2003 21.26, theresa.hilding@gcmail.maricopa.edu
wrote:

> don't know where to go from here. For example, should I redirect
> GET requests only?

Sounds like a safe bet. POST requests are tricky, and redirecting a
HEAD request probably won't be understood well by the clients using
HEAD requests..

> Is there a more efficient way to update a file's
> modification date than using system("touch <fn>")?

Just open the file for writing, and then immediately close it again.
This is essentially what touch does.

   int fd;

   fd = open(filename, O_CREAT|O_WRONLY);
   close(fd);

> I have chosen to use file modification dates to determine the last
> time an ip address issued an http request. The filename is the ip
> address. This seems to work well for my environment with less than
> 200 users.

Should work well for the purpose.

Filesystems are an often underestimated database resource.

Regards
Henrik

-- 
Donations welcome if you consider my Free Squid support helpful.
https://www.paypal.com/xclick/business=hno%40squid-cache.org
If you need commercial Squid support or cost effective Squid or
firewall appliances please refer to MARA Systems AB, Sweden
http://www.marasystems.com/, info@marasystems.com
Received on Mon Aug 11 2003 - 14:51:39 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:18:50 MST