2016-11-03 59 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