开发者

Client Side Caching of XML returned from HTTPHandler

开发者 https://www.devze.com 2023-01-26 20:12 出处:网络
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 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

精彩评论

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