网站分类RSS被客户端缓存的暂时解决办法

CNBlogs DotText 1.0 Beta 2的网站分类RSS会被客户端缓存。
添加新文章后,IE打开rss.html不会更新。
在IE选项中删除文件才可以显示更新。

找到暂时解决办法:
在\CNBlogsDottext\Dottext.Framework\Syndication\BaseSyndicationHandler.cs,WriteFeed()函数中屏蔽Cache相关语句。

protected virtual void WriteFeed()
{
if(Feed != null)
{
Context.Response.ContentEncoding = System.Text.Encoding.UTF8;
Context.Response.ContentType = "text/xml";
//Context.Response.Cache.SetCacheability(HttpCacheability.Public);
//Context.Response.Cache.SetLastModified(Feed.LastModified);
//Context.Response.Cache.SetETag(Feed.Etag);
Context.Response.Write(Feed.Xml);
}
}


屏蔽Cache对性能会有一定影响,但现在忙着其它事,没空跟下去。
有兴趣的朋友可以从\CNBlogsDottext\Dottext.Common\Syndication\RssHandler.cs中的BuildFeed()函数看下去。
posted @ 2006-04-21 12:06  pack27  阅读(284)  评论(0编辑  收藏  举报