Fetching images bundled in ZIP archives dynamically

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
verlsnake
Posts: 22
Joined: Mon Jan 28, 2008 5:42 pm

Fetching images bundled in ZIP archives dynamically

Post by verlsnake » Wed Nov 18, 2009 6:04 pm

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 ?

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Wed Nov 18, 2009 6:21 pm

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.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

verlsnake
Posts: 22
Joined: Mon Jan 28, 2008 5:42 pm

Post by verlsnake » Wed Nov 18, 2009 6:54 pm

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 ?

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Wed Nov 18, 2009 8:32 pm

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.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Fetching images bundled in ZIP archives dynamically

Post by Mark » Sun Nov 22, 2009 10:08 am

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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply