开发者

Client Side Caching of XML returned from HTTPHandler

I have an HTTPHandler that returns some XML. I am trying to figure out 开发者_运维技巧how to get this to cache in the browser, as if it were a static XML file.

I've tried this along with a few other variations and other Cache options, but nothing I do seems to make it cache (according to Fiddler).

Any ideas on how I can cache the output on the client's browser?

public void ProcessRequest(HttpContext context)
{
        context.Response.ContentType = "text/xml";
        context.Response.ContentEncoding = System.Text.Encoding.UTF8;

        context.Response.Cache.SetCacheability(HttpCacheability.Private);
        context.Response.Cache.SetMaxAge(new TimeSpan(1, 0, 0));

        string sXml = GetTableAsXml();
        context.Response.Write(sXml);
}


This thread might help you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜