So How Do You Set The Last-Modified Header?
Posted by: AspNetResources.com articles, news and updates,
on 27 Dec 2007 |
View original | Bookmarked: 0 time(s)
What happens you want to set the Last-Modified HTTP header and all you have is a UTC date? Most likely you’ll get an exception.
The culprit here is the sloppily designed interface of HttpCachePolicy. It so happens that you should pass to the SetLastModified a non-UTC date because here’s what happens inside the method:
public void SetLastModified (DateTime date)
{
DateTime utcDate = DateTimeUtil.ConvertToUniversalTime(date);
this.UtcSetLastModified(utcDate);
}
What if I only have...