I need to include an HTML page (generated by ASP.net) in a PHP page.
To do it I use:
echo file_get_contents("http://example.com");
But in this way my server needs to download the page each time my page is opened.
I'd like to add a cache system but I need to refresh the cache everytime the example.com content changes.
What is the best method (if there's any) to detect if the content is changed without download each time the entire page?
Here the HTTP header of the remote page:
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
Another site gives me these:
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