# Progressbar for Slow Loading Webpages

**URL:** <https://www.ruby-forum.com/t/progressbar-for-slow-loading-webpages/194317>\
**Category:** Rails\
**Created:** [September 2, 2010, 12:05pm UTC](https://www.ruby-forum.com/t/progressbar-for-slow-loading-webpages/194317 "2010-09-02T12:05:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sudheendra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e0b2c6/32.png) [@sudheendra](https://www.ruby-forum.com/u/sudheendra)\
**Post date:** [September 2, 2010, 12:05pm UTC](https://www.ruby-forum.com/t/progressbar-for-slow-loading-webpages/194317/1 "2010-09-02T12:05:07Z")

</div>

Hi,

I would like to show a progress bar in the browser until my pages load.

As my web pages take more that 10 seconds to load, I have decided to  
show the progres bar.

Please help me with your ideas

---

<div class="post-metadata">

**Author:** ![sudheendra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e0b2c6/32.png) [@sudheendra](https://www.ruby-forum.com/u/sudheendra)\
**Post date:** [September 2, 2010, 12:41pm UTC](https://www.ruby-forum.com/t/progressbar-for-slow-loading-webpages/194317/2 "2010-09-02T12:41:22Z")

</div>

On Sep 2, 11:05 am, Sudheendra P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hi,
> 
> I would like to show a progress bar in the browser until my pages load.
> 
> As my web pages take more that 10 seconds to load, I have decided to  
> show the progres bar.

Don’t think you can do that on a normal page - rails sends the entire  
response in one go. If you were loading some piece of content via ajax  
then you could of course do this.

Fred

---

<div class="post-metadata">

**Author:** ![sudheendra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e0b2c6/32.png) [@sudheendra](https://www.ruby-forum.com/u/sudheendra)\
**Post date:** [September 2, 2010, 12:54pm UTC](https://www.ruby-forum.com/t/progressbar-for-slow-loading-webpages/194317/3 "2010-09-02T12:54:15Z")

</div>

You already have one, most browsers have a progress bar to show that  
the page is loading.

How about putting some effort into getting the pages to load quicker?

---

<div class="post-metadata">

**Author:** ![sudheendra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e0b2c6/32.png) [@sudheendra](https://www.ruby-forum.com/u/sudheendra)\
**Post date:** [September 2, 2010, 1:03pm UTC](https://www.ruby-forum.com/t/progressbar-for-slow-loading-webpages/194317/4 "2010-09-02T13:03:37Z")

</div>

> How about putting some effort into getting the pages to load quicker?

Exactly my thought. If you want to load something huge (what that could  
be?), load a really small screen first with some “welcome. please wait”  
and then make a background call for everything else. But it would  
definitely be better to lower the request processing time (if it’s the  
case) or the size of page accessories (if it is).

- A

---

<div class="post-metadata">

**Author:** ![sudheendra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e0b2c6/32.png) [@sudheendra](https://www.ruby-forum.com/u/sudheendra)\
**Post date:** [September 2, 2010, 1:03pm UTC](https://www.ruby-forum.com/t/progressbar-for-slow-loading-webpages/194317/5 "2010-09-02T13:03:37Z")

</div>

On Sep 2, 11:05 am, Sudheendra P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hi,
> 
> I would like to show a progress bar in the browser until my pages load.
> 
> As my web pages take more that 10 seconds to load, I have decided to  
> show the progres bar.
> 
> Please help me with your ideas

JavaScript will execute as soon as it is loaded. You might be able to  
use,  
or use the ideas at:

> **[Cool Javascript Progress Bar for HTML Web Page](https://www.seabreezecomputers.com/tips/progress.htm)**
>
> Javascript Progress Bar.
> Uses the 'complete' variable on all the image elements
> to display a loading progress bar for an HTML document.

---

<div class="post-metadata">

**Author:** ![sudheendra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e0b2c6/32.png) [@sudheendra](https://www.ruby-forum.com/u/sudheendra)\
**Post date:** [September 2, 2010, 3:32pm UTC](https://www.ruby-forum.com/t/progressbar-for-slow-loading-webpages/194317/6 "2010-09-02T15:32:56Z")

</div>

Sudheendra P. wrote:

> Hi,
> 
> I would like to show a progress bar in the browser until my pages load.
> 
> As my web pages take more that 10 seconds to load, I have decided to  
> show the progres bar.
> 
> Please help me with your ideas

Page and/or fragment caching works wonders… rarely is absolutely  
everything dynamic on a page. I’ve even seen benefits from caching rows  
in an index view when assembling the data for each row requires complex  
backend work.
