Yeah, I do this too. To "dirty" the cache you can just delete the
file. I do regular rounds to delete old files.
I don't use the 404 though, that's a neat idea. Instead I register a
proc that ns_returnfiles the cache file if it exists, otherwise it makes
it and then returns it.
Bas Scheffers wrote:
On 28/09/2007, at 5:04 AM, John Buckman wrote:
I've been looking at C-caching of Tcl dynamic content, with "dirty
cache" support. For example, replacing the Tcl code that returns a
user's uploaded photo with C code.
I wrote C code to do this, and got 14k/second vs 240/s for the same
tcl function. So, C really is a good replacement for Tcl when a
particular URL needs to be very fast.
My solution to that problem was simply caching in the filesystem and
serving static files. The way this works in a multi-server environment
is that the custom 404 handler figures out the request was for
"/photo/123/axbcgsfdt.jpg" and just grabs it from the database, caches
it and redirects back to it.
That way I get the convenience of Tcl code and the speed of static
files - save for the first request.
Bas.
--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list, simply send an email to
<[EMAIL PROTECTED]> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the
Subject: field of your email blank.
--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]>
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject:
field of your email blank.