Caching the xml response from a HttpHandler

Posted by Blankman on Stack Overflow See other posts from Stack Overflow or by Blankman
Published on 2010-03-15T19:17:24Z Indexed on 2010/03/15 19:19 UTC
Read the original article Hit count: 532

Filed under:
|
|
|

My HttpHandler looks like:

public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/xml";

        XmlWriter writer = new XmlTextWriter(context.Response.OutputStream, Encoding.UTF8);

        writer.WriteStartDocument();
        writer.WriteStartElement("ProductFeed");

        DataTable dt = GetStuff();

        for(...)
        {

        }         



        writer.WriteEndElement();
        writer.WriteEndDocument();


        writer.Flush();
        writer.Close();                

    }

How can I cache the entire xml document that I am generating?

Or do I only have the option of caching the DataTable object?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about httphandler