Hacker News new | past | comments | ask | show | jobs | submit login

Meta: the linked post is undated, but available on the Wayback Machine as early as November 2005, so a (2005) in the title is warranted and, in any case, this isn't new advice...



Last-Modified: Mon, 21 Nov 2005 04:40:39 GMT


If only browsers cared about making useful infomation available.


To be fair, the Last-Modified header is very sketchy. I use it as one of the heuristics for determining the age of a website in my search engine. It's not great.

It's frequently found incorrect, both older and younger than the actual age of the document. It's a bit of a relic from back in ye olden days when websites were static .htm files in a folder, which is so rarely the case today.

It doesn't help it's also got overloaded uses via If-Modified-Since -style conditional requests.


Plenty of websites also play with the user-visible dates on websites to game search engines - most dates shown in Google results seem to be complete garbage. I don't think Modified-Since is really worse, and it at least gives you a chance to maybe get a date for static pages.

But you are right that If-Modified-Since forces it to be a date for the complete document rather than the content, which might not be as useful to normal users for dynamic pages.


Yeah, my takeaway after having attempted to do so is that properly dating websites is a very hard problem. You can get Google-level-accuracy decent guesstimates relatively easily, but going beyond that is hard.


Ctrl+i (Firefox)

Not generally useful to show this by default, because nowadays most pages are dynamically generated and although it's technically easy to implement, the last modified header is typically not set to $now.


Well, if Browsers would show it more prominently, there were more motivation to think about it for developers.

But Browsers are bad HTTP clients. Think about bad user experience with file uploads (no built in progress report!?), HTTP auth (not showing status, no logout etc.)


In Chrome you can F12 and go to "Network" tab and then refresh the page. Choose the first file in the list (that's the HTML itself) and you will find "Response Headers" in the "Headers" panel, which includes Last-Modified. It's a bit deep, which makes sense as it's rarely useful.


Last-Modified can have unwanted negative influence on caching behavior. If you want to expose metadata, there's OpenGraph et al. to do the job properly.




The deadline for YC's W25 batch is 8pm PT tonight. Go for it!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: