Load images on demand

General discussion of development ideas and the approaches taken in the 3.x branch of phpBB. The current feature release of phpBB 3 is 3.3/Proteus.
Forum rules
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.3.x. If you need support for phpBB 3.3.x please visit the 3.3.x Support Forum on phpbb.com.

If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
wecs
Registered User
Posts: 6
Joined: Fri Apr 30, 2010 4:56 pm

Load images on demand

Post by wecs »

Here is a demo http://tips.freedev.com.ar/demos/load-i ... emand.html

Something like that can save a lot of bandwidth to communities(avatars), users and the external sites victims of the |img| tag :lol:

And it seems easy to accomplish with this http://code.google.com/p/jquery-images-ondemand/ it's only add two properties on the img html tag.

Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: Load images on demand

Post by Oleg »

In order for this to be useful you have to assume people don't read the topic they are looking at.

Avatar bandwidth (but not necessarily response time) can be saved by sending 204 not modified when the avatar is not modified.

wecs
Registered User
Posts: 6
Joined: Fri Apr 30, 2010 4:56 pm

Re: Load images on demand

Post by wecs »

But people don't read all posts in all pages. So is useful. How much?

I don't know, perhaps a poll give us a better idea. Or we can use this topic to post our own experience.

In my case, at least in a 50% of times I don't read beyond the first post of the topic... so many topics, so few time.

Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: Load images on demand

Post by Oleg »

I suppose I should state for the record that this proposal makes user experience worse to potentially save some bandwidth on some servers.

I would prefer to address useless bandwidth consumption on phpbb side by returning 204 not modified/using etags for things like avatars.

For offsite images, all sane web servers already return 204 not modified for not modified static files, and for dynamic resources it's the offsite developers' job to implement this properly.

So, I think I am in fact opposed to loading images on demand.

wecs
Registered User
Posts: 6
Joined: Fri Apr 30, 2010 4:56 pm

Re: Load images on demand

Post by wecs »

The gap can be minimized.

In this page the offset is set to 50 http://tips.freedev.com.ar/demos/load-i ... emand.html
see the source

Code: Select all

// offset of bottom to load images, on px
var offset = 50;
If it's changed to this

Code: Select all

// offset of bottom to load images, on px
var offset = 1000;
The gap becomes invisible for almost all users.

It's easy to set in the original source http://code.google.com/p/jquery-images- ... ndemand.js

Of course, the offset value can be bigger to be more sure of that, even so this thing remains useful.


P.S.: The v0.2 of the plugin lies here http://jquery-images-ondemand.googlecod ... ndemand.js don't look at the v0.1 of the download section.

ToonArmy
Registered User
Posts: 335
Joined: Fri Mar 26, 2004 7:31 pm
Location: Bristol, UK
Contact:

Re: Load images on demand

Post by ToonArmy »

Forcing people to click to load images is not really something I like the idea of, however to achieve that for images posted with BBCode is really trivial with 3.0.
Chris SmithBlogXMOOhlohArea51WikiNo support via PM/IM
Image

Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: Load images on demand

Post by Oleg »

For bbcode images this is hardly necessary since those should be browser cached anyway.

wecs
Registered User
Posts: 6
Joined: Fri Apr 30, 2010 4:56 pm

Re: Load images on demand

Post by wecs »

ToonArmy wrote:Forcing people to click to load images is not really something I like the idea of, however to achieve that for images posted with BBCode is really trivial with 3.0.
There is no need to click, the images load automatically when you reach to them... javascript makes that trick possible.

You can see it in the demo page in the first post or in youtube (scroll until the end to see the effect ) http://www.youtube.com/results?search_q ... edits&aq=3

For us, the gap between the load and the show can be unnoticeable with this viewtopic.php?f=75&t=32898#p208308


In my case, in some communities, to see a topic of 100K my browser have to download 2.500K (avatars, signatures, posted images) in images... a lot of images that I don't need, I don't want and I never see.

With the load on demand thing, the browser only download the images you really need, making the browsing more efficient and fast.

The comsuption of bandwidth is more accurate, which benefit users, communities(cutting costs) and hosting companies.

User avatar
Kellanved
Former Team Member
Posts: 407
Joined: Sun Jul 30, 2006 4:59 pm
Location: Berlin

Re: Load images on demand

Post by Kellanved »

I see no reason whatsoever for including such a functionality with the core. Users who really want their board to behave in such a fashion can add such a jquery snippet by themselves just fine - even with 3.0.

Note that the bandwidth to be saved is rather marginal - avatars are only loaded once by browsers and subsequently cached.
No support via PM.
Trust me, I'm a doctor.

wecs
Registered User
Posts: 6
Joined: Fri Apr 30, 2010 4:56 pm

Re: Load images on demand

Post by wecs »

I think that wasting bandwidth is wasting a resource that costs energy, time and money.

That's the reason why I'm suggesting this feature. Besides avatars, graphic signatures and all posted images consumes bandwidth too, and double that amount, because what is a save for users is also a save for servers. At least, it's above marginal :mrgreen:

Post Reply