Permlink Replies: 22 - Pages: 2 [ Previous | 1 2 ] - Last Post: 09-May-2007 22:10 Last Post By: GeeVee Threads: [ Previous | Next ]
ONE HUMAN

Posts: 2
Registered: 24-Jan-2004
Re: PRELOAD NEXT IMAGE --> make your album faster...!
Posted: 21-Feb-2004 05:54   in response to: camner in response to: camner
  Click to reply to this thread Reply
Something like that sounds good. Hopefully some Javascript expert has an exact solution. I'm not even sure if this affects the automatic slideshow in all skins.

I should probably post this in another forum so as not to detract from this PRELOAD tip any further. I guess I'll post my question in the General Discussion forum with a link to this thread.

.....

EDIT - I've posted the question at the link below so further discussion can take place in that thread.

http://www.datadosen.se/jalbum/forum/thread.jspa?threadID=2124&tstart=0
PhotoGuy

Posts: 16
Registered: 14-Jul-2003
Re: PRELOAD NEXT IMAGE --> make your album faster...!
Posted: 21-Feb-2004 17:56   in response to: camner in response to: camner
  Click to reply to this thread Reply
Mate,

Thanks for the tip... :-)
Just uploaded a newly built sample album to http://photos.armondavanes.com

Please see if everything is okay and working with different browsers...

Thanks a lot,
Armond
mark

Posts: 10
Registered: 3-Jun-2003
Re: PRELOAD NEXT IMAGE --> make your album faster...!
Posted: 06-May-2004 16:13   in response to: Cyril Rey in response to: Cyril Rey
  Click to reply to this thread Reply
Hi guys,

Have to report a bug in this code. If a user selects "Link to originals" it will not work properly. The fix is as follows (slide.htt):

Find:

next_image.src = "<%= next.get("fileName")%>";

And replace with:

next_image.src = "<%= next.get("imagePath")%>";

Tested and implemented in ExhibitPlus 1.3a

Regards,
Mark

P.S. Since we are on the subject of "Link to originals" I've also found a bug in the standard shutterfly code. I've reported it to David.
PhotoGuy

Posts: 16
Registered: 14-Jul-2003
Re: PRELOAD NEXT IMAGE --> make your album faster...!
Posted: 08-May-2004 11:51   in response to: mark in response to: mark
  Click to reply to this thread Reply
Mark, Thank you so much :-) I appreciate your work!
The upcoming BPP v2.4 will contain this fix!

Cheers,
Armond
jp_fielding

Posts: 3
Registered: 10-May-2004
Re: PRELOAD NEXT IMAGE --> make your album faster...!
Posted: 10-May-2004 14:24   in response to: Cyril Rey in response to: Cyril Rey
  Click to reply to this thread Reply
as a suggestion, it's probably worth while to add the complementary previous preload also. i added it to the xp slide and it works great.

i know i often jump in the middle of an index page and sometimes go backwards. the cool part is, you'll only load both on the first jump into the slide. past that, scrolling in either direction, you'll have already loaded the page you were just on, so that's a freebie, and you then only load the next/previous image in the direction that you're going.
jp_fielding

Posts: 3
Registered: 10-May-2004
Re: PRELOAD NEXT IMAGE --> make your album faster...!
Posted: 10-May-2004 20:52   in response to: Cyril Rey in response to: Cyril Rey
  Click to reply to this thread Reply
while using this concept and trying to really exploit it, i decided to also look into ways to pre-cache the thumbnail screens for users on low bandwidth connections.

found a really sweet soluttion....

add an invisible iframe to your 'nextIndexPage' and/or 'previousIndexPage' to allow precaching in thumbnail view.

a sweet side effect of this, it recurses.....

so in the xp view, where i start at page 1, and before the end body tag of the screen says:

<ja:if exists="nextIndexPage">
    <!-- pre cache next page (will run recursively) -->
    <iframe width="0" height="0" iframeborder="0" src="$nextIndexPage"></iframe>
</ja:if>
jp_fielding

Posts: 3
Registered: 10-May-2004
Re: PRELOAD NEXT IMAGE --> make your album faster...!
Posted: 12-May-2004 03:09   in response to: Cyril Rey in response to: Cyril Rey
  Click to reply to this thread Reply
ie seemed to behave a little weird using that recursive style, so i switched to just a vanilla attempt to load all the images in current folder after the other thumbs are loaded.

simple really:

<ja:if exists="nextIndexPage">
	<!-- -preload all thumbs \------------------------------------------------ -->
	<script type="text/javascript">
	<%=
		for( int i = 0; i < files.length; i++){
			Map map = (Map)fileVariables.get(files[i]);
			String path = (String)map.get("thumbPath");
			out.print("\t\timage_"\+i+" = new Image();\r\n");
			out.print("\t\timage_"\+i+".src = '"\+path+"';\r\n");
		}
	%>
	</script>
</ja:if/>
GeeVee

Posts: 1
Registered: 22-Apr-2006
Re: PRELOAD NEXT IMAGE --> make your album faster...!
Posted: 09-May-2007 22:10   in response to: Cyril Rey in response to: Cyril Rey
  Click to reply to this thread Reply
I want to add an extra comment in this post
This thread is very complete on the preload topic.
But yesterday I discovered that there is more needed than only code in the slide.htt to make it work
Even with the code installed I saw 2 requests on my webserverlog - 1 for the preload and a new one with the load of the next slide

First you have the browser settings and how it uses "temporary internet files".
In IE6 check via : Extra - options - temporary internet files - settings
Here one can set when IE6 needs to check for new version of the pages (allways - when IE starts - automatically - never).
My settings were automatically and it did not work
Only after switching it to never the image was not reloaded (proof of functionality for the preload code), but this was not an option for me.

So that's how I discovered that you also need to play with the settings on your webserver
After adding this code in my .htaccess

ExpiresActive on
ExpiresByType image/jpg A900
ExpiresByType image/jpeg A900

My browser(IE6) started to reuse the preloaded image and browsing my albums became faster

Reference :
http://www.websiteoptimization.com/speed/tweak/cache/
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums