Running sites on “localhost” is extremely slow

后端 未结 18 1597
终归单人心
终归单人心 2020-12-12 22:06

Having real trouble using my localhost to test sites. It runs extremely slowly! Sometimes it takes up to a minute to load a page. I\'m using Firefox and the sites I\'m testi

相关标签:
18条回答
  • 2020-12-12 22:16

    Try to enable the Bypass proxy server for local addresses. This works for all browsers installed (Firefox, Chrome, etc).

    1. Open Internet Explorer by clicking the Start button Picture of the Start button. In the search box, type Internet Explorer, and then, in the list of results, click Internet Explorer.

    2. Click the Tools button, and then click Internet Options.

    3. Click the Connections tab, and then click LAN settings.

    4. Select the Use a proxy server for your LAN check box.

    5. Select the Bypass proxy server for local addresses

    0 讨论(0)
  • 2020-12-12 22:18

    I know the op was using an older version of IIS and this may not apply to him, but I'm posting this as it might help others. I had the same problem and none of the above IPv6 or hosts file changes worked for me. My asp.net MVC4 project was really slow after hitting F5 to refresh js changes on localhost. It was happening across all browsers - Chrome, FF, and IE. Eventually I realised I was running IIS Express 8.0 locally, and it turns out 8.0 is extremely slow when serving up js files and seems to be a bug. If I ran iisexpress on the command line and hit F5 I could see each js file took 4 or 5 seconds to load.

    I ended up uninstalling IIS 8.0 and installing IIS express 7.5 and straight away the problem was fixed. Here are the steps I followed:

    • Uninstall IIS express 8.0
    • Delete the IISExpress folder (on Win 7 it's in My Documents\IISExpress)
    • Install IIS express 7.5 (Link to IIS Express 7.5 download)

    IIS Express 8.0 seems to be installed with VS 2012 so if you had a new install or possibly a service pack update this might upgrade the previous IIS Express version.

    0 讨论(0)
  • 2020-12-12 22:19

    The cause of this for me was that the project was located on a network drive. I moved the project to the C: drive and everything ran without any delay.

    If the project is located on a network drive, try moving it to your local C: drive and try it again.

    The performance increase is much more than you would expect from just network speed. I guess VS is continually accessing the files when debugging an ASP.NET MVC application. I was using VS 2017, ASP.NET MVC debugging on IIS Express and this worked for me.

    I hope this helps.

    0 讨论(0)
  • 2020-12-12 22:21

    I'm using Wamp Server, Windows 7 and a powerful machine.

    My Apache is configured to run from a different port other than port 80. I also access my local site not via 'localhost', but a hostname mapped to my IP via dyn.com. I believe the fact that I'm running off of a different port than 80 seems to make Kaspersky's Web Anti-Virus feature very sensitive (since a lot of sketchy sites run off of different ports) and slows things down

    Disabling it seems to have solved the issue.

    0 讨论(0)
  • 2020-12-12 22:23

    I had same issues, edited my hosts file 127.0.0.1 localhost, but noticed no difference.

    I then disabled Compression in the IIS panel and applied, and problem appears to now be resolved.

    IIS Manager > Compression > Uncheck 'Enable dynamic content compression' and uncheck 'Enable static content compression'. Then 'Apply'.

    Hope this helps!

    regards, Geoff

    0 讨论(0)
  • 2020-12-12 22:24

    I just changed my hosts file from this:

    127.0.0.1       abc.com.au
    127.0.0.1       def.com.au
    127.0.0.1       hij.com.au
    

    to

    127.0.0.1       abc.com.au def.com.au hij.com.au
    

    Note: The concatenated website line cant exceed a couple of hundred characters.

    0 讨论(0)
提交回复
热议问题