I couldn’t find much information on this.
I want to compile all css (and js indeed) files into something like this:
css/all-c498dsfbc.css
Right now I’m only able to get these:
css/all.css
css/c498dsfbc.css
css/all.css?v=123
The first one sucks, because it has no cache busting at all.
The second one generates a hash which could be used for cache busting, but for some reason it doesn’t change when I change something in my .css files and then run again this:
$ php app/console assetic:dump --env=prod --no-debug
The third one sucks too because I’m required to change the version manually, as explained here: http://symfony.com/doc/current/reference/configuration/framework.html#ref-framework-assets-version. Also, I don’t think using queries for this is a good idea (I think some browsers or CDN might not like that). It would be much better if the filename was changed: ‘all-c498dsfbc.css’. This is how it’s done in Rails if I remember correctly.
Any thoughts?
EDIT
Seem like this feature is missing, I can’t believe it: https://github.com/kriswallsmith/assetic/pull/190
In our project to ensure that new content won’t be cached by Varnish for each deployment we manually change version – and assets pick that one. I think, it is a common practice. But in our case – it saves it in folder such as
web/version-1.2.3/css/all.css.Our config for
frameworksection: