1

I start the web application with F5 (Start debugging) and each time I refresh a page with F5, the cache seems to be flush.

I used Firebug with YSlow to follow the network traffic and each time I press F5 in my browser, all the http request are not in gray; files like javascript are always redownloaded.

The cache is not supposed to be flush when I hit Ctrl+F5?

I used YSlow to follow a web site other than my localhost and files are keep in cache even if I press F5.

Samuel
  • 12,073
  • 5
  • 49
  • 71
  • I found a similar question but I'm not able to figure out why the cache don't work. http://stackoverflow.com/questions/3526632/why-does-firefox-3-6-8-not-cache-static-contents-from-asp-net-developer-server – Samuel Aug 14 '12 at 16:03
  • Anytime I find that the development server is perhaps doing something it shouldn't I disregard what I believe should be "normal" and setup IIS with my project. If you can't run the full version of IIS I would recommend looking into IIS express: http://weblogs.asp.net/scottgu/archive/2010/06/28/introducing-iis-express.aspx – Jesse Aug 14 '12 at 16:50
  • @Jesse, Thank you very much for this information. After reading your article, I've searched and found this one: http://www.codeproject.com/Articles/396569/Make-Web-Development-Easier-with-IIS-Express What a nice idea to exclude the default web server of visual studio for a big one that solves all my problems about cache. – Samuel Aug 14 '12 at 18:52

2 Answers2

0

YSlow shows files cache information based on their HTTP headers regardless you reloaded the page or loaded for the very first time. It means those files is going to be cached on upcoming visits to the analyzed page.

marcelduran
  • 251
  • 2
  • 8
0

This is the expected behaviour if you hit F5 in the browser because by hitting F5 you are basically telling the browser to get everything. If you want to see the effect of your output caching (I assume that's why you expect to see "grey items") then just navigate to from the page without using F5.

MarkG
  • 1,859
  • 1
  • 19
  • 21