Page 1 of 1

Fetching images bundled in ZIP archives dynamically

Posted: Wed Nov 18, 2009 6:04 pm
by verlsnake
When I have internet aware Rev Apps that load many images dynamically from the internet, the following might be a good strategy to reduce server round trips:
- Bundle images in ZIP archives on the server-side
- Send the ZIP archives to the client-side (desktop or browser) via internet
- Unpack those images from the ZIP archive on the client-side

I'm aware of solutions implementing this strategy for Flash and Silverlight; a more general treatment proposal for this strategy came to my attention just recently:
- http://ajaxian.com/archives/resource-pa ... -packaging

Now I would like to know: What has RunRev 4.0 in store for realizing this ZIP resource bundling strategy ? That is are there approaches for unpacking ZIPs on the client-side (desktop AND web) ? And making those unpacked resources - e.g. lots of images - available to the deployed apps dynamically ?

Posted: Wed Nov 18, 2009 6:21 pm
by Janschenkel
Well, there is the built-in revZip external for working with .zip archives. So yes, you can download the .zip archive from your server, put it somewhere on the hard disk and then extract items from it.
The only 'but' for web browser revlets, is that downloading to a local file or accessing a local file for processing means the revWeb plug-in must specifically ask the user to enable disk access, which will make most people frown.

Jan Schenkel.

Posted: Wed Nov 18, 2009 6:54 pm
by verlsnake
Thanks for the answer :-) ! Heard of revZip before, but have never used it ...

Now if there was only a way to pump those locally stored resource files into the browser caches ... Because in web-based apps, those resource/image files are assumed to reside within the browser-caches when having been fetched.

No idea how internet-aware RunRev apps handle the resource/image locations:
- Desktop-based: Location is somewhere on the local hard disk
- Browser-based: Location is in the browser-caches

Is that assumption correct ?

Posted: Wed Nov 18, 2009 8:32 pm
by Janschenkel
The difference between a revlet and an AJAX solutions, is that the AJAX solution is run inside the browser, and revlets are actually run outside the browser, and merely the user interface is displayed inside the web page.
It never hurts to file an enhancement request in the Quality Control Center to ask for access to the browser cache.

Jan Schenkel.

Re: Fetching images bundled in ZIP archives dynamically

Posted: Sun Nov 22, 2009 10:08 am
by Mark
Create stacks with custom properties, which contain (sets of) pictures.

go to url "binfile:http://www.domain.com/path/stack.rev"
set the text of img x to the cJpegFileData of stack "My Stack"

or

set the text of img x to decompress(the cPngFileData) of stack "My Stack"

and finally

delete stack "My Stack"

Best,

Mark