ASP.NET MVC on Cassini: How can I force the “content” directory to return 304s instead of 200s?

前端 未结 3 1996
北海茫月
北海茫月 2020-12-14 11:27

Scenario: I have an ASP.NET MVC application developed in Visual Studio 2008. There is a root folder named \"Content\" that stores images and stylesheets. Wh

相关标签:
3条回答
  • 2020-12-14 11:48

    Are you sure the problem is caching? Because the content does get cached correctly on my machine when I run the application on Cassini.

    I think the problem you're having could be Firefox's under-performance with resolving IPv6 addresses, which causes a very annoying delay on loads with addresses like http://localhost:55555.

    What I did to change this behaviour was to change the network.dns.disableIPv6 preference on about:config to true on Firefox. I suggest trying that.

    0 讨论(0)
  • 2020-12-14 11:49

    Another option for you is to simply skip Cassini and debug under IIS. It's pretty straightforward, and won't take you ten minutes to get up and running. Browse 20 of your pages on Cassini, and you've used that time anyway ;)

    One thing I've noticed isn't always in the guides, is that if you want to debug on a different address than http://localhost/ you need to manually set the host to your local IIS. This is done by adding a line in the hosts file, located at

    C:\Windows\system32\drivers\etc\hosts

    Open the file with notepad (you need to "Run as Administrator" in order to be able to save if you're using Windows Vista and have User Account Control turned on...) and add your host. For example, to debug under http://mysite/ you add

    mysite         127.0.0.1
    
    0 讨论(0)
  • 2020-12-14 11:58

    I've had a similar problem in Chrome. To resolve this uncomment the IPv4 localhost line in you hosts file. Apparently these are commented by default in Windows 7.

    127.0.0.1       localhost
    #::1             localhost
    
    0 讨论(0)
提交回复
热议问题