View Full Version : Links inactive until complete page load

05-19-2009, 05:22 PM
I've been working on decreasing page load time and ran into something I can't figure out. The issue is not always the time involved for the page to load completely, but the fact that links and the page scroll bar are inactive until the very last element has loaded. In my case it's usually an Adsense Ad. But I've seen other large pages on other sites with lots of javascript which take just as long to load completely, but, during the process you can still scroll the page or use links. The page is still functional during the process.

What's the trick?

05-20-2009, 01:06 AM
Adsense code links to google so you will have to wait for that too load. People use many things to optimise their sites, such as includes and external scripts, small script size etc. It will take some studying if you want to know all the tricks. For a particular site, you need to post the link so I can see what they are doing.

05-20-2009, 04:11 AM
Hi quartzy,

I'm having the biggest problem with my site's forums. There are a lot of them.

Go to www(dot)realworldautomotive(dot)com(forward slash)forums(forward slash)index(dot)com and refresh a few times. See how none of the forum links become active until the top two banners open up. If I use Adsense Ads in the same spots, it's much worse. Those ads are at the end of the body and positioned absolute up top.

I've been working on page load for a while:

- Compressed all .js and .css with a YUI Compressor
- I have this in .htaccess to compress and speed up on my Apache server:

# BEGIN Compress text files
<IfModule mod_deflate.c>
<FilesMatch "\.(css|js|x?html?|php)$">
SetOutputFilter DEFLATE
# END Compress text files

# BEGIN Expire headers
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 216000 seconds"
ExpiresByType application/x-javascript "access plus 216000 seconds"
ExpiresByType text/html "access plus 600 seconds"
ExpiresByType application/xhtml+xml "access plus 600 seconds"
# END Expire headers

# BEGIN Cache-Control Headers
<IfModule mod_headers.c>
<FilesMatch "\\.(ico|jpe?g|png|gif|swf)$">
Header set Cache-Control "max-age=2592000, public"
<FilesMatch "\\.(css)$">
Header set Cache-Control "max-age=604800, public"
<FilesMatch "\\.(js)$">
Header set Cache-Control "max-age=216000, private"
<FilesMatch "\\.(x?html?|php)$">
Header set Cache-Control "max-age=600, private, must-revalidate"
# END Cache-Control Headers

# BEGIN Turn ETags Off
<IfModule mod_headers.c>
Header unset ETag
FileETag None
# END Turn ETags Off

# BEGIN Remove Last-Modified Header
<IfModule mod_headers.c>
Header unset Last-Modified
# END Remove Last-Modified Header

- Doing my best to use as few .js and .css links as possible
- Optimize and give height and width attributes to all images

My home page is actually larger than the forums, but opens faster. I'm using as little Adsense as possible on the forums. It's seems like I'm right at the borderline where one more Ad slows it down to much.

Any ideas?