【问题标题】:Apache sending corrupted or "dif" filesApache 发送损坏或“差异”文件
【发布时间】:2017-03-16 14:44:46
【问题描述】:

Apache 正在做一些非常奇怪的事情。起初,我的浏览器似乎总是在加载缓存副本。我通过禁用缓存、使用新浏览器和 curl 来排除这种情况,我 100% 确信这不是客户端缓存问题。

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

这真的很奇怪,如果我删除文件的“足够大”部分,Apache 会向我发送一个更新的文件,但这将是一个奇怪的混合或 2 个版本的错误差异。

原文:

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

在标题标签中添加一些东西没有任何作用。删除 head 标签中的所有内容均无济于事。返回相同的该死文件。

如果我删除了最后 2 个 &lt;script&gt; 标记并添加了一个标题,我会得到这个不完整的文件(注意它在脚本标记上被截断)

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

删除&lt;body&gt; 中的所有内容会导致混乱(注意标题仍为空)

<!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 还在文件末尾发送了一些奇怪的 unicode 字符

来自服务器本地主机的Curl(显示它不是缓存或js)

在服务器上使用“更多”来显示文件不是返回的内容

编辑:这是在使用 vagrant 的 CentOS VM 上运行,而 webroot 正在使用 vagrants 共享文件夹。

【问题讨论】:

    标签: html apache caching centos


    【解决方案1】:

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

    原来是使用 NFS 堆时操作系统和 Apache 的问题。

    解决方法是在httpd.conf中设置

    EnableSendfile to off
    

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

    【讨论】:

      猜你喜欢
      • 2015-05-24
      • 1970-01-01
      • 1970-01-01
      • 2017-08-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-30
      • 2013-03-18
      相关资源
      最近更新 更多