2016-11-03 58 views
1

Apache正在做一些非常奇怪的事情。起初,我的浏览器似乎总是加载一个缓存副本。我通过禁用缓存,使用新浏览器并使用curl来排除这一点,我100%确信这不是客户端缓存问题。Apache发送损坏或“不同”文件

我有一个非常小的内容的html文件,我只是改变标题中的标题,并刷新,但Apache给我完全相同的文件。

它变得非常奇怪,如果我删除了一个“足够大”的文件部分,Apache会给我发送一个更新的文件,但它会是一个奇怪的混合或两个版本的差异。

原文:

<!DOCTYPE html> 
<html ng-app="EndeavorApp" ng-controller="RootCtrl"> 
<head> 
    <title></title> 
    <link rel="stylesheet" href="css/endeavor.css" /> 
</head> 
<body> 


<div id='work-space' ng-controller="TimelineCtrl"> 
    <div id='content'> 
     <div id='project-column'> 
      <div class='project' ng-style="{height:project.$$height + 'px'}" ng-repeat="project in TCtrl.projects"> 
       {{project.name}} 
      </div> 
     </div> 
     <div id='time-line-column'> 
      <div ng-style="{width:TCtrl.timeLineWidth + 'px'}" id='block-view'> 
       <div class='project' ng-style="{height:project.$$height + 'px'}" ng-repeat="project in TCtrl.projects"> 
        <div ng-repeat="block in project.blocks" ng-style="TCtrl.getBlockStyle(block)" class='block'> 
         <div class='block-content'></div> 
        </div> 
       </div> 
      </div> 
     </div> 
    </div> 
</div> 



<script src="js/angular.endeavor.min.js"></script> 
<script src="js/endeavor.js"></script> 

</body> 
</html> 

添加一些内容标题标签也没做。去除头标签中的所有内容都没有做任何事情。同样该死的文件被返回。

如果我删除了最后2个<script>标签和添加标题我得到这个不完整的文件(请注意,切断与脚本标签)

<!DOCTYPE html> 
<html ng-app="EndeavorApp" ng-controller="RootCtrl"> 
<head> 
    <title></title> 
    <link rel="stylesheet" href="css/endeavor.css" /> 
</head> 
<body> 


<div id='work-space' ng-controller="TimelineCtrl"> 
    <div id='content'> 
     <div id='project-column'> 
      <div class='project' ng-style="{height:project.$$height + 'px'}" ng-repeat="project in TCtrl.projects"> 
       {{project.name}} 
      </div> 
     </div> 
     <div id='time-line-column'> 
      <div ng-style="{width:TCtrl.timeLineWidth + 'px'}" id='block-view'> 
       <div class='project' ng-style="{height:project.$$height + 'px'}" ng-repeat="project in TCtrl.projects"> 
        <div ng-repeat="block in project.blocks" ng-style="TCtrl.getBlockStyle(block)" class='block'> 
         <div class='block-content'></div> 
        </div> 
       </div> 
      </div> 
     </div> 
    </div> 
</div> 



<script src="js/angula 

这个烂摊子去除<body>结果一切(注标题仍然为空)

<!DOCTYPE html> 
<html ng-app="EndeavorApp" ng-controller="RootCtrl"> 
<head> 
    <title></title> 
    <link rel="stylesheet" href="css/endeavor.css" /> 
</head> 
<body> 


<div id='work-space' ng-controller="TimelineCtrl"> 
    <div id='content'> 
     <div id='project-column'> 
      <div class='p 

阿帕奇也是在文件 enter image description here

结束发送一些奇怪的Unicode字符从服务器上的本地主机

卷曲(显示它不缓存或JS) enter image description here

使用“更多”的服务器来显示文件未返回什么 enter image description here

编辑:这是一个CentOS运行VM使用vagrant和webroot使用流浪汉sharead文件夹。

回答

0

我的一个朋友解决了这个问题。所有这一切都有一个重要的细节被证明是相关的。 Apache安装在Vagrant上运行,它的webroot是流浪者共享安装。

当使用NFS堆时,发现这是操作系统和Apache的问题。

的解决是在这个位置设置这个在httpd.conf

EnableSendfile to off 

更多细节:JS and CSS files in vagrant not properly encoded when saved outside of the VM