BriteSnow / snow

A Lightweight, Google Guice, Simple, and Powerful Web Application Framework that makes building modern Web Application a breeze! Fully open source, Apache V2 licensed.
http://britesnow.com/snow
29 stars 10 forks source link

Less cache key should be based on absolute file path rather than Web URI #46

Closed jeremychone closed 9 years ago

jeremychone commented 9 years ago

Problem

Currently, the less compiled result is cached per URI. So, a URL, http://somedomain.com/css/all.less.css will have a key "/css/all.less.css"

However, when using ResourceFileLocator to allow to have the same URI "/css/all.less.css" match to different files (for example based on domain name, for multi sites), then, the first file will be cache for all the other site having the same URI.

Solution

Just use the less file absolute path as a key. The added value, is that if multiples site use the file (even if they have different URI to get to it), the right compiled result of the file will be cache.

jeremychone commented 9 years ago

Fixed in 2.0.5