4

In my website I have some pages which need to be cached on both server and client.

[OutputCache(Location= OutputCacheLocation.ServerAndClient, Duration=3600)]

But in the above attribute ServerAndClient option simply says client or server not client and server.

Other options are not even close. Is there a way to make caching on both client and server?

ozgur
  • 2,549
  • 4
  • 25
  • 40
  • 1
    How does it show that it's OR? – Sami Kuhmonen Mar 05 '16 at 11:41
  • @SamiKuhmonen **The output cache can be stored only at the origin server or at the requesting...** the C# documentation says that – ozgur Mar 05 '16 at 11:44
  • 1
    Do read the next sentence. It means proxy servers are not allowed to cache, but both client *and* server are. – Sami Kuhmonen Mar 05 '16 at 11:44
  • @SamiKuhmonen So, I can assume it caches on both server **and** client? – ozgur Mar 05 '16 at 11:45
  • 1
    Both are allowed and suggested to, but neither are forced to do that. Depends on implementation. – Sami Kuhmonen Mar 05 '16 at 11:49
  • @SamiKuhmonen thank you very much. I will check documentations in detail. – ozgur Mar 05 '16 at 11:56
  • 1
    @SamiKuhmonen - "ServerAndClient - The output cache can be stored only at the origin server or at the requesting client. Proxy servers are not allowed to cache the response. " So I read that differently. While you assume the first sentence is talking about proxy servers based on the context of the second, I do not. I think the comments are unrelated. Additionally, I just tested it and it stores it on the client, but still makes the call to the server which returns a 304 UNMODIFIED. – johntrepreneur Jul 13 '16 at 19:29
  • 1
    What @ozgur and I are looking for is like the behavior of using the combined OutputCacheLocation.Server and OutputCacheLocation.Client so that the call is never made. – johntrepreneur Jul 13 '16 at 19:30

0 Answers0