Skip to content
This repository has been archived by the owner on Sep 18, 2020. It is now read-only.

use the cache to retrieve imported less files #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jnizet
Copy link

@jnizet jnizet commented Mar 7, 2014

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant