A
alex
according to docs these two caching methods are equal:
1)
<%@ OutputCache Duration="10" VaryByParam="id" %>
2)
Response.Cache.SetExpires(DateTime.Now.AddSeconds(10));
Response.Cache.SetCacheability(HttpCacheability.Server);
Response.Cache.SetValidUntilExpires(true);
Response.Cache.VaryByParams["id"] = true;
now put code Trace.Write("INSIDE CONTROL"); into page_load()
with method 1 page actually gets cached, each following request for 10
seconds does NOT produce message "INSIDE CONTROL" in page trace info
with method 2 you will see this message on each page request
Now the question - WTF? pardon my french
ps: changing HttpCacheability enum value doesnt do anything
1)
<%@ OutputCache Duration="10" VaryByParam="id" %>
2)
Response.Cache.SetExpires(DateTime.Now.AddSeconds(10));
Response.Cache.SetCacheability(HttpCacheability.Server);
Response.Cache.SetValidUntilExpires(true);
Response.Cache.VaryByParams["id"] = true;
now put code Trace.Write("INSIDE CONTROL"); into page_load()
with method 1 page actually gets cached, each following request for 10
seconds does NOT produce message "INSIDE CONTROL" in page trace info
with method 2 you will see this message on each page request
Now the question - WTF? pardon my french
ps: changing HttpCacheability enum value doesnt do anything