Fork 0

41 lines
1.3 KiB

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:lighttpd.net:lighttpd2/doc1">
<short>caches generated content on disk if an etag response header is set; if the backend sends an already cached etag, the backend is closed and the file is sent directly.</short>
Please note: This will not skip the backend, as it will need at least the reponse headers.
Use a cron-job like the following to remove old cached data, e.g. in crontab daily:
find /var/cache/lighttpd/cache_etag/ -type f -mtime +2 -exec rm -r {} \;
Have a look at mod_deflate to see this module in action.
<action name="cache.disk.etag">
<short>cache responses based on the ETag response header</short>
<parameter name="path">
<short>directory to store the cached results in</short>
This blocks action progress until the response headers are done (i.e. there has to be a content generator before it (like fastcgi/dirlist/static file).
You could insert it multiple times of course (e.g. before and after deflate).
setup {
module_load "mod_cache_disk_etag";
cache.disk.etag "/var/lib/lighttpd/cache_etag"