1

Apache is doing something really strange. At first it seemed like my browser was always loading a cached copy. I ruled that out by disabling caches, using a new browser and using curl, I am 100% confident this is not a client side cache issue.

I have an html file with very minimal content, I simply changed the title in the header and refreshed yet Apache is giving me the exact same file.

It gets really weird, if I delete a "large enough" portion of the file Apache will then send me an updated file but it will be a weird hybrid or a bad dif of the 2 versions.

Original:

<!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>

Adding something into the title tag did nothing. Removing everything in the head tag did nothing. Same damn file is returned.

If I removed the last 2 <script> tags and add a title I get this incomplete file (note it cuts off on the script tag)

<!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

Removing everything in <body> results in this mess (note title is still empty)

<!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

Apache is also sending some strange unicode characters at the end of the file enter image description here

Curl from localhost on the server (showing it's not cache or js) enter image description here

Using 'more' on server to show file is not what is returned enter image description here

EDIT: This is running on a CentOS VM using vagrant and the webroot is using vagrants sharead folder.

Mr Lister
  • 45,515
  • 15
  • 108
  • 150
Sean256
  • 2,849
  • 4
  • 30
  • 39

1 Answers1

0

A friend of mine solved this. There was one important detail to all of this that turned out to be relevant. The Apache install is running on Vagrant and it's webroot is vagrants shared mount.

Turns out it's a problem with the OS and Apache when using an NFS mound.

The solve is to set this in httpd.conf

EnableSendfile to off

More details on this here: JS and CSS files in vagrant not properly encoded when saved outside of the VM

Community
  • 1
  • 1
Sean256
  • 2,849
  • 4
  • 30
  • 39