Page stalls for a few seconds, then loads as normal - javascript

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.

Related

Back button on browser isn't reloading webpage (uses cached) - javascript fails to execute leaving broken site

I have created a VERY basic (w.i.p) single-page photography website hosted on git hub which uses very basic HTML, CSS and some javascript.
The site works locally, but online the browser back button (Chrome, Safari) has a habit of leaving the website in a broken / non-visible state - I am struggling to understand exactly why but I believe it happens when the back button invokes a previously cached version of the page and not executing javascript.
http://www.alkchan.com/
Specific elements begin with 0% opacity and are fadedin with a javscript activated CSS tansition
I really struggle to understand why javascript isn't executed when the back button accesses a cached page, from the reading I've done I understand my best bet is using the no-cache command in something called HTTP headers, however currently I don't think I can access these on a git hub hosted web page.
Can anyone shed any light on why javascript doesn't seem to work on a cached version of the page? Thanks.

How to test whether gif images like 'Loading' are working or not?

I coded my page such that a GIF image is displayed until the web page is completely loaded. Now I'd like to test it whether it is working correctly or not. For this I need to make my web page to load slowly!! But I am not having any idea to make the web page load slowly! What can I do for a web page to load slowly? Please help me!!
You could load it via a proxy. Most of the ones on public lists are incredibly slow.
Here you can find some: http://www.samair.ru/proxy/time-01.htm
Good luck.
Add some server-side delay into your page. I assume that you're using a standard hosting provider or using your computer as a localhost and in both cases you have some form of server-side scripting.
In PHP you can do it like this:
<?php
sleep(20); // 20 sec delay
?>
Add it in the end of page, when at least your GIF animation has already sent to the client.
I'm not really sure, but you might be able to do the same using Javascript's setTimeout also.
P.S. I know that the original post didn't mention server-side scripting at all, however I assume it's possible for him/her to achieve it.

Navigation doesn't really work when I have an iframe uploading files?

I have a website that uses hashes for navigation, so it just uses javascript/ajax to load new pages in. Of course the one file, index.php loads when you load the page, then everything else is controlled via javascript. I'm now using an iFrame to upload photos, the problem is that it seems like when I click on links to go to other pages (while the iframe upload the files, since it is on the index.php page so it's not affected by switching pages) it just waits and I think it waits until the file upload is complete to load the new page I have requested. I have seen websites that do this though, my initial thought is that it could just be this: They use another server to store their files on, aside from the one the website is hosted on, therefore if it's that reason it doesn't take all the bandwidth and resources from each other. would this be the case?

How to load image while the full content loads in webpage

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

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