Hey there.
I am generating XML using linq to XML (XElements etc) from the database and with specific times. The biggest issue is that this XML will not change that often so i am trying to cache it in the code behind. Basically my code looks something like this:
XDocument x = new XDocument(
new XElement(ns + "SomeRandomDate", DateTime.Now())
);
Response.Clear();
Response.ContentType = "application/xml";
Response.Cache.SetExpires(DateTime.Now.AddSeconds(60));
Response.Cache.SetCacheability(HttpCacheability.Public);
Response.Cache.SetValidUntilExpires(false);
Response.Cache.VaryByParams["Category"] = true;
x.Save(Response.Output);
Response.End();
My biggest issue is that this does not seem to be working. Any ideas?