0

I a got a rather simple question (I hope). I run an asp.net application and I do not set any caching instructions in my web.config or IIS. I also do not include any metatags to my site.

Whenever I look at the response and request headers of my website I see the following results: enter image description here

Now I see that within my request Headers there is this: Cache-Control: no-cache and I see in the response headers: Cache-Control:private.

Now my question how does the browser get those values? Besides that, looking at other browsers give me other, but quite similair, values. So I suspect each browser has their own default Caching mechanism?

-- UPDATE --

The main reason why I am asking this is that because 10 years ago I implemented metatags to make sure nothing is cached. I needed this because I had a situation where a value on my page was updated after each POST request. But whenever I simulated a GET request the value was not updated anymore due to fact that the page was cached. I resolved this back then by adding the no-caching metatags. Nowadays I am digging into the functionality of HTML5 and found out that those metatags can not be used anymore. Now I want to reproduce the same issues of having a GET request causing my page to get cached. But I can not reproduce this anymore. Now I am researching what might cause this that I can not reproduce this anymore and everything seems not to be cached anymore.

Rotan075
  • 2,567
  • 5
  • 32
  • 54
  • *So I suspect each browser has their own default Caching mechanism*. Essentially yes. If you want a specific caching mechanism you have to set that on the server. – Liam Mar 24 '16 at 12:03
  • @Liam Yeah I know that, but then I am still wondering. Is the default caching mechanism not caching? – Rotan075 Mar 24 '16 at 12:03
  • It depends. Like I said, if you want a specific caching mechanism (or to turn caching off) you have to explicitly set it. If you don't set anything then your in the lap of the server/client and how it feels the data your sending should be cached. This could be highly variable – Liam Mar 24 '16 at 12:05
  • 1
    Yes, asp.net automatically write these tags in response. – Waqas Raja Mar 24 '16 at 12:05
  • That's not entirely true @WaqasRaja. Webforms tend to write no-cache. MVC does something different, etc. ASP.Net does not mean webforms, it's just Microsoft's web technology stack – Liam Mar 24 '16 at 12:07
  • @Liam but setting caching behaviour through metatags would then also not help because server side will always overrule clientside I guess? – Rotan075 Mar 24 '16 at 12:08
  • 1
    Typically the server set's these headers. It's telling the client, *you don't need to come back to me every time, cache this and use it* **or** *this is volatile data you need to come to me every time the user looks at it*. etc. This question would be easier to answer if you explain what your trying to achieve here? – Liam Mar 24 '16 at 12:10
  • Possible duplicate of [Disabling browser caching for all browsers from ASP.NET](http://stackoverflow.com/questions/914027/disabling-browser-caching-for-all-browsers-from-asp-net) – Liam Mar 24 '16 at 13:07

0 Answers0