Forum Moderators: phranque
Let's assume we're dealing with a website in which every single page is generated dynamically and is customized for each different member. The content of the page however remains fairly static.
Which date would you add to the Last-modified header on an ASP page? The current date/time, since that's when the page was created. Or the date the content last changed?
The problem I'm having is that some browsers, like IE, seem to make use of the above header. If I use the date of the content, and then something changes in that page's template, IE, for example, won't pick up on it unless I manually refresh the browser's cache. This is no big deal for the search engines and other crawlers since they're only after the content and thus using the date of the content as the Last-modified date is no problem. In fact it's desirable.
What about just regular folks using a normal browser, like IE I mentioned as an example above? To avoid these problems should I be doing some browser sniffing and only add the Last-modified header to my ASP pages if the user agent is a known crawler or search engine that's in my up-to-date browscap.ini file?
Your thoughts and comments will be appreciated. Thanks.
In this situation, you should use the fixed-content date for last-modified, but also set "must-revalidate" in the header. Without a must-revalidate directive, it is up to the individual browser settings whether the page will be refreshed or not. With must-revalidate, the browser will check with the server, and get new content if needed.
Possibly helpful:
[mnot.net ]
[ircache.net ]
Jim