Forum Moderators: phranque

Message Too Old, No Replies

"Last-modified"

what is best practice?

         

Martin Potter

1:52 am on Nov 4, 2017 (gmt 0)

5+ Year Member Top Contributors Of The Month



I have been including a "last-modified" comment statement near the top of the html for each of my pages. I have been using the ISO-8601 format (example : "Last-modified: 2017-11-03T21:21:43-0400"), but my html editor provides other formats,
such as Unix time (example : 1509758503)
and Unix date string (example : Fri Nov 3 21:21:43 2017)
and several conventional formats (like the simple 3/11/2017).

I have been doing this for my own benefit to recognize when I last worked on a page. I doubt any browser uses this information, so I wonder if there is a better method for me to provide this information to users, perhaps in a meta statement or an HTTP declaration. What is the recommended or best practice for this?

Or, perhaps the server automatically provides this info, so I need not worry about others.

TorontoBoy

2:34 am on Nov 4, 2017 (gmt 0)

5+ Year Member Top Contributors Of The Month



I notice Google just reindexes my whole site. My server returns 304s "Not Modified" for the ones I didn't change. Maybe there's a better way, so I'm curious.

keyplyr

5:28 am on Nov 4, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



2017-11-03T21:21:43-0400
That is the universal format used by most online: year-month-day-hour-minute-second. Sitemap.xml uses this format.

As far as SE bots, the most supported is cache settings, either at the server or the account level. Page level, it's most convienant to use meta tags.

But in my experience, while SE bots may consider this data, they pretty much do what they are programmed to do.

tangor

6:16 am on Nov 4, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The bots will do what they do, most seeing the server date change for new content. The Last modified date works really well for HUMANS who might view source code. Pick and choose based on use and need as all of them serve the same purpose.

I never include a Last modified in the header and the bots always find the new stuff.

Martin Potter

2:27 am on Nov 5, 2017 (gmt 0)

5+ Year Member Top Contributors Of The Month



Keyplyr and tangor, thanks very much. Your experience is very helpful.
Page level, it's most convenient to use meta tags.

OK, perhaps something like
<meta name='last-modified' content='2017-11-03T21:21:43-0400'>

I will try that. Thanks again.

lucy24

2:56 am on Nov 5, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



My server returns 304s "Not Modified" for the ones I didn't change.
The server can only do this with fully static content. If you've got anything else--even so much as an included php navigation header--the 304 response will no longer be sent, even if the page as such has not been modified in years.

fwiw, Googlebot includes the If-Modified-Since header on about ¼ of page requests. Seznam is similar. Bing never seems to send it, Yandex almost never. They've all got other ways of getting the information.

phranque

5:39 am on Nov 6, 2017 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



the most beneficial thing you can do for human visitors is to have the proper response headers sent for optimal browser cacheing.
this will also be beneficial for many crawlers.

one of the cache-related headers is the Last-Modified HTTP Response header:
https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.29

however in many cases it is better to Configure ETags:
https://developer.yahoo.com/performance/rules.html#etags
and Add an Expires or a Cache-Control Header:
https://developer.yahoo.com/performance/rules.html#expires

here's more on cache control...
Leverage Browser Caching  |  PageSpeed Insights:
https://developers.google.com/speed/docs/insights/LeverageBrowserCaching [developers.google.com]

seoskunk

9:16 pm on Nov 6, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have spent many hours pondering this without success, how to mimic static content on a dynamic page......

.net from memory actually is able to do this, they can alter the last modified headers etags everything but oh so I struggled to do this on Apache.

In the end I gave up but instead used last modified in sitemaps

If anyone has been able to successfully reproduce etags and last modified headers for dynamic pages I would personally be like "we're not worthy".