kriswallsmith/assetic — Issue #169: Less Filter Caching problem when using @import
Author: Konrad-Podgorski
Created: 2011-12-27 19:45:47+00:00
State: open

I've found a problem with Less Filter Module using nodejs, I will try to explain

**template**

```` smarty
{% stylesheets filter='less'
'@AcmeMainBundle/Resources/public/css/bootstrap.less'
%}

{% endstylesheets %}
````

**bootstrap.less**

```` less
/*!
* Bootstrap @VERSION
*
* Copyright 2011 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
* Date: @DATE
*/

// CSS Reset
@import "lib/reset.less";

// Core variables and mixins
@import "lib/variables.less"; // Modify this for custom colors, font-sizes, etc
@import "lib/mixins.less";

// Grid system and page structure
@import "lib/scaffolding.less";

// Styled patterns and elements
@import "lib/type.less";
@import "lib/forms.less";
@import "lib/tables.less";
@import "lib/patterns.less";
````

As you can see inside boostrap.less we got a couple @import statements. Problem is that Less Filter doesn't check if imported assets has changed, for instance reset.css. We get cached version every time even in dev environment.

Simplest solution would be a way to force recompiling less every request.

Better would be checking if file or any of it's dependencies has changed