I'm leaning http headers, and i want to run a test on the "cache-control" field,so i build a asp.net website which have only a default page.In this page i'm testing the "cache-control" field with codes in the Page_Load below:
Response.AddHeader("Cache-Control","max-age=3600");
Response.Write(new Random().Next(0,9999).ToString());
I thought it will give me the same number every time when i refresh the page cause the page is cached on local by browser when it received the "Cache-Control:max-age=3600" header,but to my surprise,it gives me a new number every time when i press the refresh button(not ctrl+f5),just like the cache-control don't work at all.
I catch the request/response information using fiddler,and see there is a "Cache-Control: max-age=0" in the request header while a "Cache-Control: max-age=3600" in the response header.It seems the "Cache-Control: max-age=0" prevents the cache,but why? Am i missing something?