Apache的缓存JavaScript的资产? [英] Apache caching javascript assets?

查看:123
本文介绍了Apache的缓存JavaScript的资产?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不久前我在和JavaScript的资产麻烦。当我更改了他们,他们也不会生效,该文件将成为无效的JavaScript(萤火引发错误和警告)。

Not so long ago I was having trouble with javascript assets. When I made changes to them they wouldn't take effect and the file would become invalid javascript (firebug throwing errors and warnings).

我注意到我的变化没有出现和特殊字符都被添加到文件的末尾。多一点挖掘,我注意到,特殊字符是我的编辑的字符数完全。

I noticed that my changes weren't appearing and special characters were being added to the end of the file. A bit more digging and I noticed that the special characters were exactly the number of characters of my edits.

原来的code:

$(document).ready(function(){
     alert('what');
});

增加一条线,应该是这样的:

Adding a line, should looks like this:

$(document).ready(function(){
     alert('what');
     alert("what's going on?!);
});

渲染这样的:

$(document).ready(function(){
     alert('what');
});��������������������������

当我研究我发现,修改Apache的配置的 /etc/httpd/conf/httpd.conf中和注释掉 EnableSendfile关闭固定的问题。

When I researched I found that modifying apache config's /etc/httpd/conf/httpd.conf and commenting out EnableSendfile off fixed the issue.

现在的问题又回来了,但Apache的配置并没有改变。

Now the issue has returned, but apache config hasn't changed.

请帮忙。我目前的解决办法是重命名文件,查看新的文件,并将其命名回来;这惹恼了我极大。

Please help. My current work around is renaming the file, viewing the new file and naming it back; this annoys me tremendously.

我在流浪盒开发,CentOS 6的,PHP 5.3 /阿帕奇2 - 最初的解决方案可以在这里找到:的共享文件夹在VirtualBox中的Apache

I'm developing on a vagrant box, CentOS 6, PHP 5.3/apache 2 - the original solution can be found here: Shared folder in VirtualBox for Apache.

不幸的是这似乎不再工作。

Unfortunately this no longer seems to work.

推荐答案

通常当 EnableSendfile在造成破损,导致EnableMMAP类似的问题。请尝试将其关闭了。你提到你使用CentOS的流浪汉,但不是主机操作系统。它是视窗或许?

Often when EnableSendfile On causes breakage, EnableMMAP causes similar issues. Try turning that off too. You mentioned that you're using CentOS in Vagrant but not the host OS. Is it Windows perchance?

这篇关于Apache的缓存JavaScript的资产?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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