public override void ProcessRequest(HttpContextBase context)
{
string name = context.Request.QueryString["name"];
SiteMapBase siteMap = GetSiteMap(name);
if ((siteMap != null) && siteMap.GenerateSearchEngineMap)
{
HttpResponseBase response = context.Response;
// Set the content type
response.ContentType = "text/xml";
// Compress
if (siteMap.Compress)
{
httpResponseCompressor.Compress(context);
}
// Write
using (StreamWriter sw = new StreamWriter(response.OutputStream, Encoding.UTF8))
{
using (XmlWriter xtw = XmlWriter.Create(sw, new XmlWriterSettings { Indent = false, Encoding = Encoding.UTF8 }))
{
WriteSiteMap(xtw, siteMap, context);
}
}
// Cache
httpResponseCacher.Cache(context, TimeSpan.FromMinutes(siteMap.CacheDurationInMinutes));
}
}