[英]YII framework is caching css file
最近,我下载了OpanBay项目来托管它。 当我尝试编辑布局时,我发现nginx和YII都在缓存css和js文件。 我试图从Nginx配置中禁用它,但仍然缓存了CSS。
在虚拟主机上,我删除了以下几行:
gzip on;
gzip_comp_level 3;
gzip_types text/plain text/css text/javascript application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss;
location ~ \.(js|css|png|jpg|gif|swf|ico|svg)$ {
fastcgi_hide_header Set-Cookie;
open_file_cache max=10000 inactive=14d;
open_file_cache_errors on;
open_file_cache_min_uses 3;
open_file_cache_valid 1m;
output_buffers 1 2m;
expires 14d;
}
在config.php上,我删除了以下几行:
'cache' => array(
'class' => 'system.caching.CFileCache'
),
但是仍然没有运气。 我不知道该框架如何工作。
Yii将其css和js文件存储在名为/assets
的目录中。 您可以删除此目录,它将自动为接收到的下一个请求创建文件。 http://www.yiiframework.com/wiki/148/understanding-assets/#hh4
但是如果您的应用程序处理不当,则删除以下内容可能会导致问题。
'cache' => array(
'class' => 'system.caching.CFileCache'
),
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.