libURL: add to cache?

David Bovill david at openpartnership.net
Mon Feb 19 14:30:14 EST 2007


On 19/02/07, Jim Ault <JimAultWins at yahoo.com> wrote:
>
> I guess the short question is "why add it to the cache?"
> If it is a local file, the access will be snappy, but if you want to
> 'preload', just put the image into a variable or custom property.


The GUI i am working on is one which fetches a lot of stuff from the web -
images, thumbnails, data etc. To speed things up I am trying to create an
interface which loads stuff that may be needed into the background
(thubnails mostly) lowing the user to interact with the GUI.

Now I "could" script this all myself but the built in libURL cache does
prety well what I want - that is the scripts just refer to the data and
images by URL - if it has nt been downloded off it goes fetches it and
caches it in case the data is needed later. So far so good.

however if you have a situatio where a few hunder thumbnails are loading in
the background and the user clicks on the GUI to display a piece of text
information or to display a particular image you want to get that piece of
data straight away. This is where I get problems.

Firstly the blocking calls sometimes return empty due to ongoing loads to
the same domain (I think) and secondly once I have the image or data - Id
like to use the same code to display it later nd not write my own caching
malarky - duplicating what the internet library does - that is I"d like to
add the image or data to the internet libraries cache so that as with the
rest of the data later calls to the url fetch it as per normal.



More information about the use-livecode mailing list