What should you recommend?

You are designing an ASP.NET Web application.
The Web application must instruct proxy servers between the server and the browser to not cache content.
You need to recommend an approach for instructing the proxy servers.
What should you recommend?

You are designing an ASP.NET Web application.
The Web application must instruct proxy servers between the server and the browser to not cache content.
You need to recommend an approach for instructing the proxy servers.
What should you recommend?

A.
Use the Response.Cache.SetNoTransforms() method.

B.
Use the Response.Cache.SetVaryByCustom() method with a value of no-proxy.

C.
Use the Response.Cache.AppendCacheExtension() method with a value of no-proxy.
D. Use the Response.Cache.SetCacheability() method with a value of HttpCacheability.ServerAndPrivate.

Explanation:
HttpCacheability Enumeration
NoCacheSets the Cache-Control: no-cache header. Without afield name, the directive applies to the entire
request and a shared (proxy server) cache must force a successful revalidation with the origin Web server
before satisfying the request. With a field name, the directive applies only to the named field; the rest of the
response may be supplied from a shared cache.
PrivateDefault value. Sets Cache-Control: private to specify that the response is cacheable only on the client
and not by shared (proxy server) caches.
ServerSpecifies that the response is cached only at the origin server. Similar to the NoCache option. Clients
receive a Cache-Control: no-cache directive but thedocument is cached on the origin server. Equivalent to
ServerAndNoCache. ServerAndNoCacheApplies the settings of both Server and NoCache toindicate that the
content is cached at the server but all others are explicitly denied the ability to cache the response.
PublicSets Cache-Control: public to specify that the response is cacheable by clients and shared (proxy)
caches.
ServerAndPrivateIndicates that the response is cached at the server and at the client but nowhere else. Proxy
servers are not allowed to cache the response.
http://msdn.microsoft.com/en-us/library/system.web.httpcacheability.aspx



Leave a Reply 0

Your email address will not be published. Required fields are marked *