DPChallenge: A Digital Photography Contest You are not logged in. (log in or register
 

DPChallenge Forums >> Web Site Suggestions >> Preload next image
Pages:  
Showing posts 1 - 7 of 7, (reverse)
AuthorThread
11/03/2004 03:42:11 PM · #1
It would be nice having the option to preload the next image while viewing the photo I'm voting on. Just a couple of lines of javascript code which would make voting a lot easier for us born without patience.

Not that is a big deal... Just a cool extra feature =)

Edit: On a 512kb/s (64k/s dl speed) connection it takes at least 2,4sec to load 150kb image. 2,4sec x 200 images = 468,75 sec = 7,8 minutes

Regards,
Steinar Hugi

Message edited by author 2004-11-03 15:45:46.
11/03/2004 05:31:22 PM · #2
And those lines are... ?

-Terry
11/03/2004 05:38:35 PM · #3
It would be worthwhile doing a 'just in time' cache of the next image that you'll look at, in the majority of cases. If the voter clicks off to do something else, it isn't a huge overhead, assuming that typically if you are voting, what you do is actually vote, hence load the next image in line, the majority of the time.

Edit: actually, looking at the source, the image to preload is already indicated in the file, in the field NEXT_ID & CHALLENGE_ID. So when the source file is being created, the following lines could be added:

imgcache = new Image();
imgcache.src ="//images.dpchallenge.com/images_challenge/${CHALLENGE_ID}/${NEXT_ID}.jpg";

Or whatever the correct substitution syntax is, in the language used when the pages are being created.
and that should be it.

Message edited by author 2004-11-03 17:53:21.
11/03/2004 06:40:01 PM · #4
The only drawback to this approach is that for each new session I create, the first image I view will take twice as long to load up. Might not be annoying for most users, but I know I tend to log on and off (and on and off, ad nauseum) the site a million times a day.

Still, the overhead of having another img variable active during a page view is probably negligible on the client end. Server-side????
11/03/2004 06:46:20 PM · #5
Originally posted by bledford:

The only drawback to this approach is that for each new session I create, the first image I view will take twice as long to load up. Might not be annoying for most users, but I know I tend to log on and off (and on and off, ad nauseum) the site a million times a day.


I don't think this is true - assuming the code is placed in the right order in the file. The first page will take twice as long to load, but you will still see the first image in the same amount of time.
11/03/2004 06:49:41 PM · #6
I'm off to try to implement this feature and provide working, sample code. Gordon, I might PM you for some help.
11/03/2004 07:13:33 PM · #7
Originally posted by ClubJuggle:

And those lines are... ?

-Terry

Haven't tested the code so maybe it has some errors... Shouldn't though.
Edit: Found one typo =)

----
# Head stuff
if(isset($_GET['preload_next'])) {
if($_GET['preload_next']>0) $_SESSION['preload_next'] = true; # Assuming you're using sessions
else $_GET['preload_next'] = false;
} else $_GET['preload_next'] = false;

?>



&preload_next=1\';'?>> Preload next photograph





Message edited by author 2004-11-03 19:20:44.

Pages:  
Current Server Time: 08/30/2025 04:33:42 PM

Please log in or register to post to the forums.


Home - Challenges - Community - League - Photos - Cameras - Lenses - Learn - Help - Terms of Use - Privacy - Top ^
DPChallenge, and website content and design, Copyright © 2001-2025 Challenging Technologies, LLC.
All digital photo copyrights belong to the photographers and may not be used without permission.
Current Server Time: 08/30/2025 04:33:42 PM EDT.