Skip to main content
100%

less cached for Lighttpd

✓ Published0🌍 Public
HHoffmannP
Last edited May 11, 2015
Created on May 11, 2015

This example demonstrates a caching mechanism for compiling Less stylesheets into CSS on a web server using Lighttpd. The shell script stores compiled output in `/tmp` based on a SHA512 hash of the source file, so subsequent requests reuse the cached version. It runs `lessc` with the `--clean-css` option to minify the result, and integrates with Lighttpd’s CGI module via `cgi.assign` to handle `.less` files. The script prints a comment indicating the compilation took time, but only computes that duration when the cache is built, showing the performance benefit of avoiding recompilation.

AI-generated description

Similar vizzes