Symfony 2.0 conditional dump generates invalid names in debug mode

I compress my javascripts through assetic (a block in twig for all scripts in one directory), which works fine in prod mode. Now I want to use debug mode for my prod env, so I switch assetic to debug in the config, clear the cache and unload assets with debugging.

This works for some javascripts, but not for all. Symfony adds the suffix number to them, which is higher (one at a time) on the website (javascript tag) as opposed to the real file. Sometimes clearing the cache and flushing solved the problem again, but this time noot.

For example: It resets: /web/js/main_part_3_jquery-ui_6.js but uses: /web/js/main_part_3_jquery-ui_1.js

So how can I solve this?

Edit: The wron suffix does not appear on the first request to the site after clearing the cache.

+5
source share
2 answers

Since it is app/console assetic:dumpreasonable for cached files yml, you should clear the cache to reset assets every time you change the configuration.

It is best to do this in this sequence:

rm -rf app/cache/*
app/console assets:install web
app/console assetic:dump

Of course, with debugging keys, necessary environments, etc.

+3
source

I had a similar problem with multiple generated assets and symfony, not including a good one on display.

This was due to the fact that in my case cache cache was disabled and it was clearly incorrectly configured. (apparently this is useful when you need a new version of your files, for example, when you update your .js in dev, but don't want to break prod)

config.yml .

assetic:
    workers:
        cache_busting:
            enabled: false
+2