0

Symfony2 (v2.4) prevent the use of the new "workspace" feature in chrome and CoffeeScript sourcemap for debugging because it comes with cache busting enabled by default.

{% javascripts    
'bundles/js/scriptA.js'
'bundles/js/scriptB.js'
 %}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}

This will output :

<script type="text/javascript" src="/bundles/js/abcde_script_1"></script>

Reading the docs they actually explain that we can't configure cache busting to do what they do by default...It is puzzling ! (cf. Symfony2 documentation)

In short would like to have as a result :

<script type="text/javascript" src="/bundles/js/scriptA.js"></script>
<script type="text/javascript" src="/bundles/js/scriptB.js"></script>

This problem arose in dev environment

RewriteRule (.+) /app_dev.php/$1
4

1 回答 1

0

您可以通过添加来覆盖负责在 a{% javascripts %}{% stylesheets %}标记中生成后缀资产的调试设置debug=false

{% javascripts    
    'bundles/js/scriptA.js'
    'bundles/js/scriptB.js'
    debug=false
 %}
    <script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}

之后清除缓存。

于 2013-10-30T14:16:53.400 回答