静态资产无法使用symfony2 clear cache命令刷新 [英] Static assets not refreshing with symfony2 clear cache command

查看:81
本文介绍了静态资产无法使用symfony2 clear cache命令刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Assetic和指南针过滤器来传递和编译.scss文件。安装程序的这部分工作正常。但是,我的理解是,在app_dev环境中,Symfony 2会针对每个页面加载重新编译所有资产(包括CSS),而不使用它在产品环境中使用的缓存系统。

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.

这似乎没有发生。

当我对.scss文件进行更改时,它只会如果使用以下命令,则生效:

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?

推荐答案

我想我在这里找到了答案:

I think I've found the answer here:

固定罗盘过滤器,更改导入文件时css不更新(google网上论坛讨论)

似乎,如果对导入的文件进行了更改,而对父文件没有任何更改,则将不会重新编译父文件。直到您强制重新编译,才能看到更改的结果。

It seems that if a change is made to an imported file without any changes to the parent file then the parent file will not be recompiled. The result being the change will not be seen until you force recompilation.

Google网上论坛的发布者建议您通过编辑AsseticController进行修复(破解!)。我还没有尝试过,但是即使可以使用,我还是不想编辑供应商软件包。

The poster on google groups suggested a possible fix (hack!) by editing the AsseticController. I haven't tried it yet, but even if it works I'd rather not edit a vendor package.

这篇关于静态资产无法使用symfony2 clear cache命令刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆