If you set caching (as below) in an HTTP handler, will it be cached on the server or client or both?
_context.Response.Cache.SetCacheability(HttpCacheability.Public);
_context.Response.Cache.SetExpires(DateTime.Now.AddSeconds(180));
If you set caching (as below) in an HTTP handler, will it be cached on the server or client or both?
_context.Response.Cache.SetCacheability(HttpCacheability.Public);
_context.Response.Cache.SetExpires(DateTime.Now.AddSeconds(180));
The code you used above will cache the content on the clients browser.
If the expiry date of the content is within the time specified then the browser (client side) will issue a 304 "Not Modified" i.e. The Content is cached and not re fetched from the server.
Hope this helps
G
This sets the http header, which means it will be cached by:
Cache-Control: public to specify that the response is cacheable by clients and shared (proxy) caches.
http://msdn.microsoft.com/en-us/library/system.web.httpcacheability%28VS.71%29.aspx
Regards --Jocke
For the following call:
_context.Response.Cache.SetCacheability(HttpCacheability.Public);
it turns out that in addition to setting the Cache-Control: public
HTTP header, it also enables server-side output caching.