我的网站从另一个网站加载iframe。我想缓存这个iframe,然后加载一个缓存副本。
不幸的是,我不能使用nginx,这就是为什么我对如何使用php / js / ajax / xml或其他方式缓存iframe感兴趣。
可能是这样的:
- create iframe.php file on server with loading another site iframe
- iframe.php load iframe first time, than cache it
- include iframe.php where I need (but I don't
underst
我有两个网站将共享一些资源,比方说,index.php,functions.js和style.css,这些脚本将用于网站上几乎所有的页面。
我有两个观众要迎合(就下载速度而言),在同一网络内的用户托管的网站(100 to / same )和外部用户。
我正在寻找缓存各种脚本(.js、.css、.php)的最佳方法,并举例说明如何在可能的情况下使用它们的优缺点来完成这些工作。所谓缓存,我指的是本地、网络和服务器缓存。
注意: index.php是一个动态页面,应该每2小时从缓存中刷新一次。如果您从.js、.css、.php或组合开始您的答案,那么我可以很容易地看到您正在讨论的缓存
前几天我发现了,并将我的网站的页面速度从大约75提高到现在的大约95。
它推荐的最后几件事之一是我:
Leverage browser caching: Setting an expiry date or a maximum age in the HTTP headers
for static resources instructs the browser to load previously downloaded resources
from local disk rather than over the network.
我的主要javascript和css文件的缓存时间设置为2天,Go
我正在创建一个非常小的网站,使用XML在平面文件中存储一些信息(数据库不需要)。现在一切正常,但每次我更新XML文件时,无论我尝试刷新页面或重新启动服务器多少次,更改都不会反映在页面上。我使用的是"PHP XML DB“,这是一个可以在PHP中轻松使用XML进行CRUD的类。PHP类可以在https://www.phpclasses.org/package/9314-PHP-Store-and-retrieve-data-records-in-XML-files.html#information中找到。