16 December 2009 11:02a Pacific

Speeding up localhost in Visual Studio

by Matt Sherman

I recently put a new SSD in my system (yay!) and did a clean install of Windows 7, Visual Studio, etc. I found that when viewing my web app on localhost (using the Cassini web server built into VS), it was very slow. This was true across browsers.

Turns out it’s a DNS thing – the lookup for “localhost” was apparently going out to the DNS server, a waste. You can easily “short-circuit” this by modifying your hosts file. It’s in the C:\Windows\System32\drivers\etc folder.

Simply un-comment the localhost entry at the bottom of that file, like so:

# localhost name resolution is handled within DNS itself.
	127.0.0.1       localhost
#	::1             localhost


It made things lickety-split for me.

Tip: you’ll need to run Notepad as an administrator to modify the file.

notepad

Comments are closed

Tell others

TwitterTweet this page
Digg!Digg this page
TwitterAdd to Google Reader

Experimental! Let me know how it works for you.

Shorten this page's URL

Learn more about the TinyASP URL shortener

ASP.Net jQuery Controls

Implement jQuery effects using familiar ASP.Net server controls. Learn more...

Recent posts

Avoiding “magic strings” in jQuery, C# and ASP.net MVC

Alikewise learnings #1: DIY PR

Sherman’s law of prior knowledge, or, predicting the past

The busiest people at Apple right now…

When “infographics” jump the shark

HTTPS is the least of your problems

Stacking up

Beware the truth-tellers

more...  

About us

ClipperHouse.com is brought to you by Matt Sherman and Fernando Chilvarguer, among others. Contact us here.