prefetch

mfdc's picture

They have: 160 posts

Joined: Aug 2004

I want to prefetch all my graphics and dynamic content before my index page is displayed.

How is the best, simplist and efficient way of doing this?

He has: 629 posts

Joined: May 2007

A lot depends on what you are trying to achieve. You can load images without displaying them immediately with JavaScript, CSS, or plain ol' HTML. The choice will very much depend on what you eventually want to do with those images.

Can you describe your scenario for us?

Cordially, David
--
delete from internet where user_agent="MSIE" and version < 8;

He has: 1,380 posts

Joined: Feb 2002

A good example of what you are calling 'prefetching' is seen on Google Reader. It displays a "Loading" graphic until the needed feeds (and associated data) are loaded into the viewing pane... and then displays them.

This can be done with JavaScript (and some Server-Side Scripting for your dynamic content... like PHP)... you can preload a whole page, just portions, or just graphics. If you search around the internet you'll find many pre-written examples.

If you want to get really fancy and try and only load a certain number of items at a time, and then load another set of items when they are needed (ala Google Reader again)... that's a little tricker.

In summary, you're going to need to implement some form of AJAX if your 'pre-fetching' involves dynamic content.

Busy's picture

He has: 6,151 posts

Joined: May 2001

If you need to use a prefetch on a index page then your index is to bloated, trim your content, images and code for faster loading.

mfdc's picture

They have: 160 posts

Joined: Aug 2004

cheers guys

Over time, my web design skills have come on in leaps and bounds. My index page, just like all my sites, are all streamlined, validated and are as efficient as possible. However, I want a splash screen with a 'loading' site routine, and I actually want it to do just that, as opposed to just be something knocked up in flash for the sake of it.

There are probably only ten major images in my whole site

?

Im thinking CSS is the way to go

Busy's picture

He has: 6,151 posts

Joined: May 2001

flash + index + prefetch = dialup users nightmare, as well as search engines ...

If your index pages content (everything including the source code) is under 40kb it should load instantly for anyone faster than dialup, dialup uses may get a second or two delay.

Remember people are lazy and get bored quick, you have only seconds to lure a surfer into your site, and thats just from content, if you add load time on top of that you'll be loosing more than you get to stay.

Golden rule - just because you can doesn't mean you should (re flash)

He has: 1,380 posts

Joined: Feb 2002

Why would you want to make a splash screen if it both serves no purpose and isn't needed?

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.