lunatech-labs/play-module-less — pull request #22 by jnizet (2014-03-07 15:36:58+00:00)
Title: use the cache to retrieve imported less files

I have noticed a bug in the code which detects if less files have been modified.
The code gets the imports by reading the less file, then stores the imports in the cache. At the next request, it reads the imports from the cache, but ignores the result, and thus re-reads the file.

On my MacBookPro with a SSD, this leads to times of around 150 ms. to return a 304 - Not Modified response. After the fix, we're down to 3 ms. On a low-end web server with a regular disk, the times are about 1.5 seconds for each 304, instead of a few milliseconds.

Note that there is another bug, not fixed by this PR: the code stores new entries in the cache every time a file is modified, but it never removes the old entries.