Assuming that you used the AETHER_BASE method to specify the location of the data files, you'll need to set the environment variable. Using apache: BrowserMatch .* AETHER_BASE=/var/www/emergent/index.cgi
Once you've applied this patch, you can check to see that your blog still works, and additionally that it creates files in the new -cache directory. When you strings one of them, it should look like a list of filenames that the page depends on, followed by the HTTP response.
Now you can test the cache by going to its URL. If it serves up pages from your site, and it responds really quickly to the second query for a page, then it's working. Check that after touching a file the next page generation is slow again. It will also log some diagnostic information in the apache error.log.
+def hack_action(name, query): + parts = name[1:].split("/") + query['action'] = parts[0] + for p in parts[1:]: + if "=" in p: + a, b = p.split("=", 1) + query[a] = b + else: + query['__args__'] = query.get('__args__', '') + ' ' + p + return '', query @@ def perform_request(name, query): if name[:1] == u'/': # should always be true. name = name[1:] + if name.startswith("_"): + name, query = hack_action(name, query) + correct_name = correct_case(name)Now, you can use a URL like http://emergent.unpythonic.net/_atom/hasname=1/name= instead of http://emergent.unpythonic.net?action=atom&hasname=1&name=, making your RSS feed benefit from caching as well. You can redirect users of the legacy URL to the cached URL too:
RewriteRule ^/\?action=atom\;hasname=1\;name=$ /_atom [R,L] RewriteRule ^/\?action=atom\&hasname=1\&name=$ /_atom [R,L]
Files currently attached to this page:
cache.patch | 4.2kB |
cgicache.c | 3.3kB |