网络服务器使用旧的非现有文件来呈现网站

问题描述:

我有我的文件上传到我的网站。当我查看网站时,在线html看起来像这样: enter image description here网络服务器使用旧的非现有文件来呈现网站

但是,这绝对不是在线文件。我试过多次更新它。但是,它仍然会呈现我很久以前使用的文件。我试图删除我的缓存和Cookie。但出于某种奇怪的原因,它仍然设法使用旧的删除文件...为什么?

,应该是网上看起来像这样的html:

{% extends "layout.html.twig" %} 

{% block content %} 

<div id="preloader"></div> 

<div id="s1" class="hero"> 
    <div id="menu_block" name="menu_block" class="menu_block right"> 
     <nav class="nav_block"> 
      <a href="#s1">Home</a> 
      <a href="#s2">About</a> 
      <a href="#s3">Projects</a> 
      <a href="#s4">Skills</a> 
      <a href="#s5">Resume</a> 
      <a href="#s6">Contact</a> 
     </nav> 
    </div> 

    <div class="container vertical center"> 
     <div class="title white"> 
      Lex de Willigen 
     </div> 
     <div class="subtitle white"> 
      DEVELOPER 
     </div> 
     <div class="subsubtitle"> 
      <i>Hello, my name is Lex and I'm <br> 
      a developer from the Netherlands!</i> 
     </div> 
    </div> 
</div> 

<div id="s2" class="section"> 
    <div class="container vertical center" style="margin-top: 10px;"> 
     <i class="fa fa-user fa-4x"></i> 
    </div> 
    <div class="container vertical center" style=""> 
     <h2 style="font-weight: 900; font-family: arial; color: black;"> 
      WHO AM I? 
     </h2> 
    </div> 
    <div class="container vertical center" style=""> 
     <p> 
      <b>Hi!</b> My name is Lex. 
      <h3 class="animate">And I'm developer</h3> 
     </p> 
    </div> 
</div> 

<div id="s3" class="section"> 
    <div class="container vertical center" style=""> 
     <h2> 
      Projects 
     </h2> 
    </div> 
</div> 

<div id="s4" class="section"> 
    <div class="container vertical center" style=""> 
     <h2> 
      Skills 
     </h2> 
    </div> 
</div> 

<div id="s5" class="section"> 
    <div class="container vertical center" style=""> 
     <h2> 
      Resume 
     </h2> 
    </div> 
</div> 

<div id="s6" class="section"> 
    <div class="container vertical center" style="width: 50%;"> 
     <h2> 
      Contact 
     </h2> 

     {% if form is defined %} 
      <form action="" method="post"> 
       {{ form_widget(form) }} 
      </form> 
     {% endif %} 
    </div> 
</div> 
{% endblock %} 

一些额外的细节:

  1. 我使用的Silex框架
  2. 出于某种原因,我从来没有得到我的javascript工作,虽然这可能是因为新的文件永远不会加载
  3. 当需要时,我可以给我的网站,以防您想检查什么可能是问题
+0

您遇到此问题只能从您的计算机或其他设备?我的意思是,如果您尝试从例如您的手机访问此页面,您还会获得旧文件? –

+0

你使用'cloudflare'吗?如果是,请尝试从cloudflare仪表板中清除缓存。 –

+0

@AlbertoMartinez不,我已经在2台电脑上试过了,都遇到同样的问题 –

您的服务器端缓存。请检查php.ini是否将opcache过期时间设置为过长。

  • Opcache可以缓存。

  • Nginx Web服务器缓存。

+1

我已经发现如何删除缓存!页面正在更新 –

+0

哦,很酷,这样Opcaches缓存页面?对? –

+0

不,在我的Silex项目(我正在使用fabpot框架)中保存缓存的地方。我删除了这些文件夹中的所有内容,然后再次运行! –