Speeding Up FireFox When Using the ASP.NET Development Server from Localhost
2008-07-11 06:24
567 查看
Ref: http://scottonwriting.net/sowblog/posts/13367.aspx
I have long used FireFox as my default browser for surfing the web,
but I typically test my ASP.NET pages on Internet Explorer for a couple
of reasons:
Some of the larger software projects I work on are developing
intranet applications, where all users' browsers are fixed (IE 6 for
one client, IE 7 for another).
For book and article and tutorial screen shots I typically use IE
as my browser of choice because IE is still, after all, the most used
browser.
Until Visual Studio 2008, Visual Studio used IE as the browser when
debugging an ASP.NET application (even if FF was setup as the default).
Because all of my clients are still on ASP.NET 1.x or 2.0, I don't use
VS 2008 too often.
However, I have recently been working on some AJAX material and have
been using VS 2008 more frequently. Visual Studio 2008 kindly launches
my default browser (Firefox) when I debug my web application. The
problem was I noticed that Firefox was loading pages very slowly. I'd visit a site through localhost (via the ASP.NET Development Web Server) and pages would take several seconds to load.
To help analyze the problem I used the excellent Firefox extension Firebug (which I reviewed in the March 2008 issue of my Toolbox column). Firebug
will show you the total number of network resources downloaded when
visiting a page, along with the time it took to download each.
Each resource - from the 4KB HTML fiel to the 7KB JPG file, was
taking close to a FULL second to retrieve! When requesting this same
page from a remote, production web server, download times were 5 to 10
times faster per resource. What was going on here?
I next opened Internet Explorer - the same pages loaded instantaneously. I fired up Fiddler,
an excellent HTTP Debugger for IE, and noted that the resources were
being downloaded in 0.02 seconds, nearly 500 times faster than from
Firefox. By now I was seriously stumped. I then did what I should have
done from the getgo - I searched the web. Duh!
Turns out that there is a known issue with Firefox's IPv6 support
and the ASP.NET Web Development Server that introduces these lengthy
delays. To quote from the Mozilla Wiki:
IPv6 was designed in part to solve the problem IPv4 will soon be
facing: the exhaustion of all possible IP addresses. Mozilla
implemented IPv6 support in early 2000, but that support did not
receive widespread testing until recently as IPv6-capable OSs and
network software/equipment became more common. One particular bug that
has appeared exists not in Mozilla, but in IPv6-capable DNS servers: an
IPv4 address may be returned when an IPv6 address is requested. It is
possible for Mozilla to recover from this misinformation, but a
significant delay is introduced.
...
Two approaches were taken to work around these bugs: first, a
preference to globally disable IPv6-based DNS lookups browser-wide
(this preference [network.dns.disableIPv6]), and a blacklist of domains which should never have IPv6-based DNS lookups performed (network.dns.ipv4OnlyDomains).
Consequently, to fix this problem of slow response times when
visiting localhost using Firefox, either set the network.dns.diableIPv6
configuration property to true or set the network.dns.ipv4OnlyDomains configuration property to “localhost”. My search led me to many pages around the Web suggested that you set the nework.dns.disableIPv6 property to true, but this would disable IPv6 support for all sites visited by the browser (at least according to the Wiki documentation). Therefore I set the network.dns.ipv4OnlyDomains property to “localhost”.
To set these properties, fire up Firefox and type about:config
in the address bar. Next, locate the appropriate setting and change its
value to the desired one. With that small change the debug-time
experience in Firefox is greatly enhanced. And make no mistake,
Firefox's rich library of extensions make it a great browser for web
development. (I'll share some of my favorite Firefox web development
extensions in a future blog post.)
Lesson for the day: If you bump up to a problem, search for a solution online first.
If your search is fruitless then take the time to investigate it
further, otherwise you may spend 15 minutes troubleshooting a problem
that is already well-known and has a simple solution.
posted on Wednesday, July 09, 2008 1:54 PM
I have long used FireFox as my default browser for surfing the web,
but I typically test my ASP.NET pages on Internet Explorer for a couple
of reasons:
Some of the larger software projects I work on are developing
intranet applications, where all users' browsers are fixed (IE 6 for
one client, IE 7 for another).
For book and article and tutorial screen shots I typically use IE
as my browser of choice because IE is still, after all, the most used
browser.
Until Visual Studio 2008, Visual Studio used IE as the browser when
debugging an ASP.NET application (even if FF was setup as the default).
Because all of my clients are still on ASP.NET 1.x or 2.0, I don't use
VS 2008 too often.
However, I have recently been working on some AJAX material and have
been using VS 2008 more frequently. Visual Studio 2008 kindly launches
my default browser (Firefox) when I debug my web application. The
problem was I noticed that Firefox was loading pages very slowly. I'd visit a site through localhost (via the ASP.NET Development Web Server) and pages would take several seconds to load.
To help analyze the problem I used the excellent Firefox extension Firebug (which I reviewed in the March 2008 issue of my Toolbox column). Firebug
will show you the total number of network resources downloaded when
visiting a page, along with the time it took to download each.
Each resource - from the 4KB HTML fiel to the 7KB JPG file, was
taking close to a FULL second to retrieve! When requesting this same
page from a remote, production web server, download times were 5 to 10
times faster per resource. What was going on here?
I next opened Internet Explorer - the same pages loaded instantaneously. I fired up Fiddler,
an excellent HTTP Debugger for IE, and noted that the resources were
being downloaded in 0.02 seconds, nearly 500 times faster than from
Firefox. By now I was seriously stumped. I then did what I should have
done from the getgo - I searched the web. Duh!
Turns out that there is a known issue with Firefox's IPv6 support
and the ASP.NET Web Development Server that introduces these lengthy
delays. To quote from the Mozilla Wiki:
IPv6 was designed in part to solve the problem IPv4 will soon be
facing: the exhaustion of all possible IP addresses. Mozilla
implemented IPv6 support in early 2000, but that support did not
receive widespread testing until recently as IPv6-capable OSs and
network software/equipment became more common. One particular bug that
has appeared exists not in Mozilla, but in IPv6-capable DNS servers: an
IPv4 address may be returned when an IPv6 address is requested. It is
possible for Mozilla to recover from this misinformation, but a
significant delay is introduced.
...
Two approaches were taken to work around these bugs: first, a
preference to globally disable IPv6-based DNS lookups browser-wide
(this preference [network.dns.disableIPv6]), and a blacklist of domains which should never have IPv6-based DNS lookups performed (network.dns.ipv4OnlyDomains).
Consequently, to fix this problem of slow response times when
visiting localhost using Firefox, either set the network.dns.diableIPv6
configuration property to true or set the network.dns.ipv4OnlyDomains configuration property to “localhost”. My search led me to many pages around the Web suggested that you set the nework.dns.disableIPv6 property to true, but this would disable IPv6 support for all sites visited by the browser (at least according to the Wiki documentation). Therefore I set the network.dns.ipv4OnlyDomains property to “localhost”.
To set these properties, fire up Firefox and type about:config
in the address bar. Next, locate the appropriate setting and change its
value to the desired one. With that small change the debug-time
experience in Firefox is greatly enhanced. And make no mistake,
Firefox's rich library of extensions make it a great browser for web
development. (I'll share some of my favorite Firefox web development
extensions in a future blog post.)
Lesson for the day: If you bump up to a problem, search for a solution online first.
If your search is fruitless then take the time to investigate it
further, otherwise you may spend 15 minutes troubleshooting a problem
that is already well-known and has a simple solution.
posted on Wednesday, July 09, 2008 1:54 PM
相关文章推荐
- Downloading files from a server to client, using ASP.Net, when file size is too big for MemoryStream using Generic Handlers (ashx)
- [转]Setting up an ASP.NET website development environment using Visual Studio .NET, Subversion, and Windows XP
- 运行asp.net时弹出the status code returned from the server was:404错误提示
- asp.net development server配置方案 无法连接到 Visual Studio 的 Localhost Web 服务器
- Using IIS Express as ASP.NET Development Server
- ASP.NET development server failed to start listening on port (dynamic port) & Error Unable to connect to Visual Stutio's localhost web server
- VS2005中用firefox访问 Asp.net Development Server 的站点的方法
- Chapter 1__1.6 Connecting to SQL Server Using Integrated Security from ASP.NET(集成安全连接数据库)
- CodeSnip: How to Get Id of the Record Using ASP.NET and SQL Server 2000
- The ASP.NET Development Server
- Using the Index Server to create Query Page in asp.net
- VS2008中的ASP.NET Development Server 无法访问 http://localhost:端口号
- Using The Amazon Web Service From ASP.NET
- [收藏]The Baker's Dozen: 13 Tips for Building Database Web Applications Using ASP.NET 3.5, LINQ, and SQL Server 2005 Reporting Services
- How to configure the Virtual Path of ASP.NET Development Server to be “Root”
- How to get the Values of Selected Row from a Gridview using ASP.NET
- ASP.NET makes uploading files from the client to the server a snap(UploadInterface.PostedFile.SaveAs)
- VS2008无法启动asp.net development server
- IIS7运行ASP程序时出现【An error occurred on the server when processing the URL】
- Vs2005 asp.net development server未能开始侦听端口