Unfortunately I can't do that. we have literally terrabytes worth of files and the cache would quickly over flow the reason for setting up mod cache is to only cache the files that are required. Unfortunately I don't know ahead of time which files are going to be wanted.
I had thought of setting up a fastcgi process to fetch the file into the cache on the very first request but the first person to request the file would get a failed response and unless I set up some sort of memcache to track every request I would have to "push cache" every request even if they were duplicates.
I have also noticed some files simply refuse to cache. I am really not sure why. thats why i hoped you could specify under what conditions mod_cache wont cache.
If I enable logs on the backend server I see the same file requested over and over. each time with a 200 response code and a valid content-length (debugging output for an example is below)
I am not really looking for elegant or one line fixes, I am well past that now. I don't mind coding up an entire module. Its just that I am really not sure where to start.
A nice flow diagram of the way lighttpd processes requests would really help. particularly something that shows the order in which modules are called and how lighty deals with multiple modules that register the same handlers.
Tomorrow I will set up a test server and try and trace the entire process. enabling debugging output on the current server sends an impossible amount of data to the logs and tends to confuse more than help.
Chris
=============================================================
debugging output from the backend server showing what is sent to mod_proxy_core
=============================================================
response.c.226: (trace) -- splitting Request-URI
response.c.227: (trace) Request-URI : /source/video.wmv
response.c.228: (trace) URI-scheme : http
response.c.229: (trace) URI-authority:
65.171.60.17
response.c.230: (trace) URI-path : /source/video.wmv
response.c.231: (trace) URI-query : (null)
response.c.285: (trace) -- sanitizing URI
response.c.286: (trace) URI-path : /source/video.wmv
mod_access.c.138: (trace) -- handling file in mod_access
response.c.402: (trace) -- before doc_root
response.c.403: (trace) Doc-Root : /mnt/rawfiles
response.c.404: (trace) Rel-Path : /source/video.wmv
response.c.405: (trace) Path : (null)
response.c.458: (trace) -- after doc_root
response.c.459: (trace) Doc-Root : /mnt/rawfiles
response.c.460: (trace) Rel-Path : /source/video.wmv
response.c.461: (trace) Path : /mnt/rawfiles/source/video.wmv
response.c.480: (trace) -- logical -> physical
response.c.481: (trace) Doc-Root : /mnt/rawfiles
response.c.482: (trace) Rel-Path : /source/video.wmv
response.c.483: (trace) Path : /mnt/rawfiles/source/video.wmv
response.c.501: (trace) -- handling physical path
response.c.502: (trace) Path : /mnt/rawfiles/source/video.wmv
response.c.510: (trace) -- file found
response.c.511: (trace) Path : /mnt/rawfiles/source/video.wmv
response.c.663: (trace) -- handling subrequest
response.c.664: (trace) Path : /mnt/rawfiles/source/video.wmv
mod_access.c.199: (trace) -- handling file in mod_access
mod_staticfile.c.327: (trace) -- checking file for static file
mod_staticfile.c.352: (trace) -- handling file as static file
plugin.c.386: (trace) -- plugins_call_...: plugin 'staticfile' returns 2
response.c.675: (trace) -- subrequest finished
2008-05-18 00:28:10: (response.c.137) Response-Header:
HTTP/1.1 200 OK
Content-Type: source/x-ms-wmv
ETag: "-625156571"
Accept-Ranges: bytes
Last-Modified: Sun, 18 May 2008 06:13:32 GMT
Content-Length: 23231024
Date: Sun, 18 May 2008 07:28:10 GMT
Server: lighttpd/1.5.0