I am learning the concept of caching in MVC and was going through this article. There is a property of the OutputCache attribute 'Location' with following possible values:
Any (Default): Content is cached in three locations: the web server, any proxy servers, and the web browser.
Client: Content is cached on the web browser.
Server: Content is cached on the web server.
ServerAndClient: Content is cached on the web server and and the web browser.
None: Content is not cached anywhere.
I want to know when would we use the Location value Client
and Server
and why would we prefer one over the other.
If you want to cache user specific information go for server option. for eg. if your view returns the logged in user, then you need to use server option. If your view content is same for all the users, then use client option, it will be cached in the browser.