Static assets not refreshing with symfony2 clear cache command Static assets not refreshing with symfony2 clear cache command symfony symfony

Static assets not refreshing with symfony2 clear cache command


if you are working with symfony 2 assets in dev. environment, simply use this command:

php app/console assets:installphp app/console assetic:dump --watch

Since version 2.4 --watch is deprecated, and has been replaced by:

php app/console assetic:watch


I think I've found the answer here:

assetic compass filter, css not updating when changing imported file (google groups discussion)

It seems that if a change is made to an imported file without any changes to the parent file then the parent file will not be recompiled. The result being the change will not be seen until you force recompilation.

The poster on google groups suggested a possible fix (hack!) by editing the AsseticController. I haven't tried it yet, but even if it works I'd rather not edit a vendor package.


Asset compilation is not part of the caching system. You need to re-install assets when you make changes, regardless of the environment.

app/console assets:install web

If the filesystem you're on supports symbolic links, you can avoid having to run this command for every change and instead just install the assets as such

app/console assets:install web --symlink

But since you're using Sass, this probably isn't an option for you.

HTH