How to load image while the full content loads in webpage - javascript

Hi i have webpage taking too long to load due to acsx controls and DB calls. before loading the content , page took 3-4 secs leaving blank screen for users. So what is the best way , so that i can load a loading gif when it is taking 3-4 secs to get content from server. So that there will be no blank white page when user go to page

Have you thought about using a minifyer to compress your javascript? Like this one. Also Jeff Atwood wrote a blog post about HTTP compression and IIS6 you can read here.

Take a look a GZIP:
http://www.west-wind.com/weblog/posts/2007/Jun/29/HttpWebRequest-and-GZip-Http-Responses

Related

Website loading issue

My developer coded the home page coming soon template. before now it was working fine the site was loading up but now it keeps loading.
I have created a screen cast video to clear the issue and share entire page code.
Here is the link Screencast
In Portfolio you have two images (res.png and pizza.png). Loading both of them require 7800ms. Your whole request is nearly 8700ms. (in my current environment/using my network connection). Those two images are 90% of your loading time.
You also have two resources that are required but not there:
cp.png
ff.png
Both of them being in that Portfolio folder.
Loading time
Loading time for res.png
Loading time for pizza.png
Red lines are 404 http responses (Not Found).

Loading time more in Iphone safari

I am trying to load my web page in mobile(IPhone), In chrome browser it taking only 3 seconds but in safari it taking almost 2 minutes to load a entire page, Is there any specific reason for this behavior? If is it so how can I overcome this?
If I had a link to your page I could tell you exactly what is causing the problem.
The second biggest issue with mobile carriers is the number of simultaneous requests allowed. A desktop will download about 6 page resources like CSS, JS, and images (http requests) simultaneously. Mobile, one, maybe two.
The biggest issue is the tower will often drop the radio signal between the phone and the tower between each request. It takes about 2 seconds for the phone to reestablish the connection with the tower.
With mobile it is very important to minimize the number of http requests per page.
You want to make sure your http response header contains a Content: keep-alive for each http request.
Do not have unused CSS selectors.
Much the used CSS is inefficient and bloated by use of over qualified selectors.
Most web pages have multiple CSS files linked in, most unused. Most pages only require a small amount of CSS which could fit withing the pages <head><style> rather than being linked in.
There should never be more than one CSS file.
Javascript should not be used to layout the page. All JS does for layout is alter the HTML and CSS that should be have been done by the page designer. When JS is needed, it should be loaded after the page renders.

How to download video in background HTML5 / JS

Is there a way to make a video download in the background (Possible on a different thread?) than I get my images and do webrequests?
Situation:
I show a video, video plays fine.
But, once I start getting 2 images at the same time from that server, the page won't response and will wait for my video to have finished loading, then it loads the images within a few seconds. (about 100kb per image).
If I try to open any other page on the same browser and the crashed page's server it won't load untill the crashed page is done loading, however any other site(For example google) will just load fine.
So is there a way to make the browser not want to download full video, or maybe just give priority to images?
This sounds like the server throttling your requests, as everything apart from scripts always load asynchronously in a browser.
It might be that you are only allowed so much bandwidth per second from the server - or so many connections - and that could be the reason why the server won't respond until your first request has finished.
Check your server configuration and perhaps have a play with it to exclude this possibility.
Maybe you can try a worker, it provides a way to execute background scripts (you will have to split your video and images in separate files), as you can see in the Use Cases it refers to "Prefetching and/or caching data for later use" as a possible scenario. Hope it helps.
More info here:
http://www.html5rocks.com/en/tutorials/workers/basics/#toc-examples

Page stalls for a few seconds, then loads as normal

I recently moved a wordpress site over to a different server, but when the front page loads, it stalls for a few seconds, then process to load the page. Im not entirely well versed in web development. Any help?
http://phoenix-productions.tv/v2
Thanks,
Jeff
Static files (images, CSS, JavaScript, sound) are loading fine. It's your PHP page that can take up to 10-15 seconds to load. Without looking at the code it's difficult to debug, but take a look at your homepage code (maybe index.php or in some theme file) and check around the area where it echos out the client login image. Always seems to pause around there for a while.
Check PHP code near:
<img src="http://phoenix-productions.tv/v2/wp-content/themes/phoenix/style/social-client.png" style="vertical-align:middle">
Other options might include installing and setting up caching for your website. Try the default WP cache or a plugin called SuperCache.

Preload external website content, then redirect

When leaving a website my user get a message you are now leaving, which redirects after 4 seconds. Can that time be used to somehow preload the target site's content, so that after the redirect the site appears faster?
If the site to be fetched is on your domain, you can parse the next file with JavaScript and request the assets.
If not, you can't figure out its assets (not via XHR anyway, most of the time) so you can't preload them. You could hack it by placing the site in a hidden iframe. You could also use your server as a proxy, to get a list of assets and pass it to your HTML to start preloading them.
You could try also using this meta tag...
<link rel="prefetch" href="/images/big.jpeg">
Source.
It is a lot of effort for arguably not much gain though.
You could start loading the site into an invisible <iframe>. If it's cached properly, this will reduce load time when the user actually enters the page.
This would however have all kinds of potential side effects, like autoplay music and videos starting in the background.
I would tend to leave this kind of preloading to the web browser (and/or the prefetch tag that #alex shows!)

Categories