Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Static assets not refreshing with symfony2 clear cache command

I'm using Assetic with the compass filter to pass and compile .scss files. This part of the setup seems to work fine. However, my understanding was that in the app_dev environment, Symfony 2 would recompile all assets (including css) for each page load and not use the caching system that it employs for prod environment.

This seems not to be happening.

When I make a change to a .scss file it will only take effect if I use:

 app/console cache:clear

I thought the whole point of the dev environment was to avoid having to do this each time?!

I've checked the permissions of the cache folders (to be safe I've set them so anybody can read and write). Does anybody have any suggestions?

like image 205
musoNic80 Avatar asked Jul 10 '12 17:07

musoNic80


1 Answers

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

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

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

php app/console assetic:watch
like image 110
Capitaine Avatar answered Sep 19 '22 14:09

Capitaine