我需要在 PHP 页面中包含一个 HTML 页面(由 ASP.net 生成)。
为此,我使用:
echo file_get_contents("http://example.com");
但是这样我的服务器每次打开我的页面时都需要下载页面。
我想添加一个缓存系统,但每次example.com内容更改时我都需要刷新缓存。
检测内容是否在每次整个页面都没有下载的情况下更改的最佳方法(如果有的话)是什么?
这里是远程页面的 HTTP 标头:
HTTP/1.1 200 OK =>
Cache-Control => no-cache
Pragma => no-cache
Content-Length => 63648
Content-Type => text/html; charset=utf-8
Expires => -1
Server => Microsoft-IIS/7.5
Set-Cookie => ASP.NET_SessionId=xxxxxxxxxxxxxxxx; path=/; HttpOnly
X-Powered-By => ASP.NET
X-AspNet-Version => 4.0.30319
X-UA-Compatible => chrome=1
X-CID => 2-18
Date => Thu, 12 Sep 2013 08:54:59 GMT
Connection => close
另一个网站给了我这些:
Server Response HTTP/1.1 200 OK
HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 65367
Content-Type: text/html; charset=utf-8
Expires: -1
Server: Microsoft-IIS/7.5
Set-Cookie: ARRSID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx;Path=/;Domain=.example.com
Set-Cookie: ASP.NET_SessionId=xxxxxxxxxxxxxxxxxxx; path=/; HttpOnly
X-Powered-By: UrlRewriter.NET 2.0.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
X-UA-Compatible: chrome=1
X-Powered-By: ARR/2.5
X-Powered-By: ASP.NET
X-CID: 1-18
Date: Thu, 12 Sep 2013 08:56:03 GMT