IMO, http requests are bad for your app as they tend to be a bottleneck area depending on the concurrent requests a browser makes (older browsers do only two connections at a time for example). But with modern browsers you can count on them being smart and loading the same image from the local cache instead of hitting the server. So in general terms you could probably not worry about it and never see unneeded requests.
That being said, you end up counting on "magic" on the browser's part and would be better off ensuring your app only calls Asset.images once to preload the images and then just cloning the resulting image elements as needed to ensure no unneeded requests are ever made. On Nov 23, 9:38 am, stratboy <[email protected]> wrote: > Because I really can't do it :) > > So, is there anyone that can answer my original question? > > I've taken a look to the class Assets, and it seems it doesn't check > if images are already cached. I've also tried to see some tracing from > firebug and safari activity and it seems the don't reload images. I > don't know if this is always true, and if it's true for IE too. > > Any guru? :) > > On 22 Nov, 20:48, CroNiX <[email protected]> wrote: > > > > > I guess my question is why you are retrieving the same data twice? > > Why not just reuse the result from the first request? > > > On Nov 21, 6:39 am, stratboy <[email protected]> wrote: > > > > Hi! I've got a little question: let's suppose I'm using Assets.images > > > twice (in the same page) and to load, say, the same 5 images. Does the > > > second call generate 5 more http requests? Is that bad or I shoudn't > > > worry about it?
