Search squid archive

object refresh question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I have squid setup as an accelerator to serve cgi stuff. The cgi is pretty cpu intensive, takes about 20 seconds to process request, so, I have the requests cached as much as possible.

Problem is when to purge the cached cgi results. The cgi does NOT have last modified header.

1. is it possible, when doing the HEAD command on the CGI, have it return the last mod date, but not execute the CPU intensive stuff. a. Possible complication: the content length will be 0 when doing HEAD. If the obj is already cached, then cached content length will be differ from the HEAD content length.

2. Can squid refresh object based on the folloing algo:

if (not_cached){
        retrive_it
        mark it as fresh
        set obj to expire in 7 days
        return it
}
else if (is_fresh){
        return it
}
else if (time_retrived > last_mod){
mark the object as fresh for another 7 days (request from the next 7 days won't bother doing last_mod check, assume it's fresh)
        return it
}


thx,
mike

[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux