just a silly quick question, i set up Bootstrap 3 follow by the steps from here. It works at dev mode but no prod mode. Just want to ask what kind of problem can cause that? If need codes, I will show it later. Thank you.
-
what do you mean with "It not works in prod mode" - what does exactly not working? more information would be helpful.develth– develth2014-08-29 07:02:44 +00:00Commented Aug 29, 2014 at 7:02
-
2Did you run `app/console --env=prod assets:install web´ and ´app/console --env=prod assetic:dump´ on production server ?Hpatoio– Hpatoio2014-08-29 07:12:15 +00:00Commented Aug 29, 2014 at 7:12
-
You all right, I have to dump assets in prod mod. Cause I set "use_controller" as false. THXGaryZ– GaryZ2014-08-31 23:34:34 +00:00Commented Aug 31, 2014 at 23:34
Add a comment
|
1 Answer
You have to dump your assets on production. During development, assetic converts the assets each time you request them. Because that'll cost some time, it doesn't do this in production. So, you have to dump the assets (which means assetic only converts the assets once) in production.
$ php app/console assetic:dump --env=prod --no-debug
Read more about this in http://symfony.com/doc/current/cookbook/assetic/asset_management.html#dumping-asset-files-in-the-prod-environment
1 Comment
GaryZ
Thanks, it's solved! In dev, I dont wanna dump the assets, it makes a lot files. But in prod, it seems better to use dump, its faster