为什么对一些php文件的更改需要这么长时间才能显示在活动网站上 [英] Why do changes to some php files take so long to show on the live site

查看:121
本文介绍了为什么对一些php文件的更改需要这么长时间才能显示在活动网站上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用WordPress。有时当我更新主题中的某些PHP文件时,更改会立即显示在活动网站上(例如header.php)。但是,当我对CSS文件夹(skin.php)中的php文件进行更改时,例如,这些更改可能需要几个小时才能反映在活动的网站。任何想法为什么这需要这么长时间,如果有任何是强制它更新。听起来像高速缓存问题,但我已清除我的本地缓存,并尝试了其他浏览器从未到过这个网站,更改不显示。所以也许在服务器上的某种类型的缓存?我不使用任何缓存插件。

I'm using WordPress. Sometimes when I update certain php files in the theme the changes show on the live site right away (header.php for example). However when I make changes to php files in the CSS folder (skin.php) for example, it can take several hours for these changes to be reflected in the live site. Any idea why this takes so long and if there's any was to force it to update. Sounds like a cache issue, but I've cleared my local cache and tried other browsers that have never been to this site and the changes do not show. So maybe some type of cache on the server? I'm not using any cache plugins.

示例网站如果这有帮助。 http://freemanep.com/

Example site if this helps. http://freemanep.com/

感谢。 / p>

Thanks.

推荐答案

我使用Mark Jaquith的解决方案(见这里)来停止我的样式表被缓存。

I use Mark Jaquith's solution (see here) to stop my stylesheets being cached. Not sure it applies in your case, given it happens on a new browser, but it's worth a try.

实质上,您会在网址中附加档案修改时间戳记,因此,当文件更改时,浏览器认为URL已更改并下载最新版本。 Mark的例子,对于主题样式表:

In essence you append the file modification timestamp to the URL, so when the file changes, the browser thinks the URL has changed and downloads the latest version. Mark's example, for the theme stylesheet:

<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); echo '?' . filemtime( get_stylesheet_directory() . '/style.css'); ?>" type="text/css" media="screen, projection" />

这篇关于为什么对一些php文件的更改需要这么长时间才能显示在活动网站上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆