Hi,
Does anybody know how I could implement a If-Modified-Since Header, as recommended by Google, into my site. I’m guessing you just need to grab the last modified variable but I’m not sure of the syntax of the header for MODx etc. Any help would be much appreciated.
I'm also looking for a way to output the date a document was edited into the http header: Last-Modified
It would really help with implementing Varnish Cache!
-
☆ A M B ☆
- 3,141 Posts
Theoretically you should be able of doing this with an uncached snippet which simply calls the php header() function, with the value of $modx->resource->get('editedon').
Practically (and to do it right) you may need to be more careful with sending those headers - comments may be added to a page, a menu may change, sidebar contents can be retrieved from other pages which changes.. all of which wont affect the editedon value. Judging from what I found about that header online that could have serious SEO issues if not done right..