Simulate Latency with ASP.NET
I'm developing an AJAX-heavy site with JavaScript MVC and an ASP.NET MVC server. To test some of the client-side caching and get a better idea of where to put loading gif开发者_运维技巧's and messages into the site I would like to artificially simulate some latency on the server.
I guess the easiest way would be to use a Global Action Filter and simply do a Thread.Sleep, but this won't work for when the client loads JavaScript files and other content.
I'm guessing I can do this with an HttpModule, but I'm note sure.
Any ideas?
Edit: This is for testing on my local/development machine, using IIS Express
Looks like most straightforward solution would be to leverage bandwidth throttling by reconfiguring IIS: Enabling Bandwidth Throttling (IIS 6.0)
Also here is a trick to simulate a modem connection when using a Fiddler using the menu option
Rules > Performance > Simulate Modem speeds
精彩评论