caching - Is possible to intercept a request for a nonexistent file with lighttpd? -


Is it possible to configure lighttpd so that a request for the file is successful if the file exists , For example, the CGI script is handled and redirected, if the file does not exist?

The one I am trying to achieve is a set of image files on disk that is generated by a script and will directly generate a script image if the file is not present, at the request of the service. And will save it to disk (for future requests) and then either the image will serve directly or redirect to the same URL which will be successful this time. I'm essentially caching the output generated on the disk.

I currently have a prototype in which the script always handles the request, the file reads and resonates if it exists, but I instead save the overhead and serve directly if Lighttpd is possible.

You can be the best of both worlds. If you see it

  X-Sendfile: path to file  

, then the lighttpd will serve the file:. There is a PHP example on the documentation page.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -