I am using lighttpd to serve static files. I have a bunch of images in a dir that I regularly update. This will change the file content (and filesize) as well as the modification date, but not their filename.
When I access the files through http, the updates are not taken into account and lighty serves the old file. I can manually rename the file to something different, then lighttpd will return a 404 error, and if I rename my file back, I will get the correct updated version. Seems like lightty is using some kind of cache mechanism of its own (which is fine) to return static files. Unfortunatly, it seems that this mechanism doesn't update itself when files are modified.
I checked through Wireshark, and my browser is really doing a request to the file, this is not a browser caching issue. It returns a 200 OK when requesting it from an empty cache, and a 304 Not Modified otherwise, as expected. But the file is returned with a wrong Last-Modified header that do not reflect the real last modification date.
Maybe there is some config directive that I am not aware of ?
I would like the files returned by lighty to reflect the changes made on disk directly, or at least being able to invalidate its cache.
Update for anyone following this question : I found a culprit. If I update a static file, Lighty does not return the new content, but does return the new Content-Length in its headers, resulting in garbage displayed. If I compress the file using mod_compress, the issue goes away as mod_compress uses its own caching system. Unfortunatly, I can't compress all the files (image files for example). So it is only a partial fix, but I'll get back to it later and will hoepfully find a solution.