Response. expires = 0; response. buffer = true; response. expiresabsolute = datetime. now. addseconds (-1); response. addheader ("Pragma", "No-Cache"); response. cachecontrol = "no-Cache"; // response. write ("{\" nowtime \ ": \" "+ datetime. now. tostring ("mm/DD/YYYY hh: mm: SS", system. globalization. datetimeformatinfo. invariantinfo) +
"\"}");
Context. response. clearcontent ();
Context. response. contenttype = ("text/XML; charset = gb2312"); // you must set it here; otherwise, the client cannot receive the XML file written here.
Context. response. cache. setcacheability (httpcacheability. nocache); // No Cache
String result = createxmlresult (keyword );
Context. response. Write (result );
Context. response. Flush ();
Context. response. End ();
<Meta http-equiv = "expires" content = "0"> <meta http-equiv = "cache-control" content = "no-Cache"> <meta HTTP -equiv = "Pragma" content = "no-Cache"> <% response. buffer = true; response. expiresabsolute = datetime. now. adddays (-1); response. cache. setexpires (datetime. now. adddays (-1); response. expires = 0; response. cachecontrol = "no-Cache"; response. cache. setnostore (); %>
Simplest data cache
Httpcontext. Current. cache. insert ("simplifyesfurl", dsurl, null, datetime. Now. addminutes (1), timespan. Zero );
Httpcontext. Current. cache. Get ("simplifyesfurl ")
File dependency Cache
Cache. cachemanager. Set (cachename, DT, new system. Web. caching. cachedependency (xmlpath ));