H. Peter Anvin wrote:How about extending gitweb to check to see if there already exists a cached version of these pages, before recreating them? e.g. structure the temp dir in such a way that each project has a place for cached pages. Then, before performing expensive operations, check to see if a file corresponding to the requested page already exists. If it does, simply return the contents of the file, otherwise go ahead and create the page dynamically, and return it to the user. Do not create cached pages in gitweb dynamically. Then, in a post-update hook, for each of the expensive pages, invoke something like: # delete the cached copy of the file, to force gitweb to recreate it rm -f $git_temp/$project/rss # get gitweb to recreate the page appropriately # use a tmp file to prevent gitweb from getting confused wget -O $git_temp/$project/rss.tmp \ http://kernel.org/gitweb.cgi?p=$project;a=rss # move the tmp file into place mv $git_temp/$project/rss.tmp $git_temp/$project/rss This way, we get the exact output returned from the usual gitweb invocation, but we can now cache the result, and only update it when there is a new commit that would affect the page output. This would also not affect those who do not wish to use this mechanism. If the file does not exist, gitweb.cgi will simply revert to its usual behaviour. Possible complications are the content-type headers, etc, but you could use the -s flag to wget, and store the server headers as well in the file, and get the necessary headers from the file as you stream it. i.e. read the headers looking for ones that are "interesting" (Content-Type, charset, expires) until you get a blank line, print out the interesting headers using $cgi->header(), then just dump the remainder of the file to the caller via stdout. Rogan - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg Kroah-Hartman | [PATCH 005/196] Chinese: add translation of SubmittingDrivers |
| Andy Whitcroft | Re: 2.6.21-rc7-mm2 -- x86_64 blade hard hangs |
| Rafael J. Wysocki | 2.6.26-rc1-git9: Reported regressions from 2.6.25 |
git: | |
| Andy Grover | [PATCH 01/21] RDS: Socket interface |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | [GIT]: Networking |
| Gerrit Renker | [PATCH 03/37] dccp: List management for new feature negotiation |
