javascript - Simulate loading on localhost - Stack Overflow

I have a site which uses AJAX and preloaders. Now I would like to see the impact of these preoloaders b

I have a site which uses AJAX and preloaders. Now I would like to see the impact of these preoloaders before deploying the site online.

The "problem" is that localhost doesn't have loading time and the response is immediate, so that I can't see my preloaders.

How can I simulate loading or limited bandwidth (with Firefox, Rails or whatever else)?

I have a site which uses AJAX and preloaders. Now I would like to see the impact of these preoloaders before deploying the site online.

The "problem" is that localhost doesn't have loading time and the response is immediate, so that I can't see my preloaders.

How can I simulate loading or limited bandwidth (with Firefox, Rails or whatever else)?

Share Improve this question asked Jul 2, 2009 at 13:59 collimarcocollimarco 35.6k37 gold badges115 silver badges155 bronze badges
Add a ment  | 

5 Answers 5

Reset to default 3

If on windows, download Fiddler and set it to act like you are on a modem:

Tools-->Performance-->Simulate Modem Speeds

[edit] Since you said you are now on a MAC, you have Charles which has throttling [/edit]

I don't have a rails app in front of me right now but why don't you just add a delay to the appropriate controller?

i.e.

def index
    # ...
    sleep 2        # sleeps for 2 seconds
    # ...
end

Alternatively, use a debugger and place a breakpoint in the controller code. This should mean that your preloader will show until execution is continued.

One option would be to deploy the site briefly to the host you will be using for production under an alternate URL for performance testing.

However, the way it performs for you won't necessarily be the same for everyone else in other locations.

If you provide some more detail on what these "preloaders" are and how they work and what you mean by "see the impact" we might be able to give better answers. Do you mean you want to eyeball the AJAX spinner gifs and get a feel for how it will look to the end user as the loading takes place? Or do you mean you want to do some kind of formal benchmarking on them?

You can use Firebug plugin to Firefox to determine the network behavior of your page. This works fine for localhost. You should see all images being retrieved simultaneously at the time of the preload execution.

You could configure your router so that it forwards requests on a certain port to the puter you're running the website on. Then, when you open your.ip.add.ress:the_port in your browser, the bottleneck will be your upload speed, which is generally quite low.

But that's just how I would do it ;)

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745270694a4619727.html

相关推荐

  • javascript - Simulate loading on localhost - Stack Overflow

    I have a site which uses AJAX and preloaders. Now I would like to see the impact of these preoloaders b

    2小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信