Note that there are some explanatory texts on larger screens.

plurals
  1. PODownload page only if different from the cached version
    primarykey
    data
    text
    <p>I need to include an HTML page (generated by ASP.net) in a PHP page.</p> <p>To do it I use:</p> <pre><code>echo file_get_contents("http://example.com"); </code></pre> <p>But in this way my server needs to download the page each time my page is opened.</p> <p>I'd like to add a cache system but I need to refresh the cache everytime the <em>example.com</em> content changes.<br> What is the best method (if there's any) to detect if the content is changed without download each time the entire page?</p> <p>Here the HTTP header of the remote page:</p> <pre><code>HTTP/1.1 200 OK =&gt; Cache-Control =&gt; no-cache Pragma =&gt; no-cache Content-Length =&gt; 63648 Content-Type =&gt; text/html; charset=utf-8 Expires =&gt; -1 Server =&gt; Microsoft-IIS/7.5 Set-Cookie =&gt; ASP.NET_SessionId=xxxxxxxxxxxxxxxx; path=/; HttpOnly X-Powered-By =&gt; ASP.NET X-AspNet-Version =&gt; 4.0.30319 X-UA-Compatible =&gt; chrome=1 X-CID =&gt; 2-18 Date =&gt; Thu, 12 Sep 2013 08:54:59 GMT Connection =&gt; close </code></pre> <p>Another site gives me these:</p> <pre><code>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 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload