From Google
Make sure your web server supports the If-Modified-Since HTTP header.
This feature allows your web server to tell Google whether your
content has changed since we last crawled your site. Supporting this
feature saves you bandwidth and overhead.
We run a Umbraco website and am wondering how to satisfy this requirement, I understand that there is issues with the data been “dynamic” and would like to at least say let it expire after 1 day.
This my client and her SEO representative feels is important due to the last Google update.
Thanks in advance guys!!!
This isn’t related directly to Umbraco but rather more general description of how I solved a similar situation.
I first made sure that a LastModified/LastUpdated field exist in the database and that it’s being updated when ever a post is inserted or updated. I then send it to the client using the Last-Modified HTTP-Header.
When the client then requests the same page again, and sends the If-Modified-Since header, I look at the date it sent. Compared it to the value in the database. If it’s the same I returned a Status 304 Not Modified to the client and stopped execution of the ASP.NET code.
If the values where different, I load the page as usual.
So basicly all I had to do was to was to send a Modified-Since header to the client, read the If-Modified-Since header from the client and do one extra if on that value. This should be possible to do in Umbraco, but since I don’t run it myself I can’t tell you exactly where to do the changes.