Asynchronous upload via post?

Dave Cragg dave.cragg at lacscentre.co.uk
Wed Jun 13 08:37:35 EDT 2007


On 13 Jun 2007, at 13:06, David Bovill wrote:

> Yes - thanks Dave!
>
> NB - I'd still like to be able to manually add something to the url  
> cache?
> Scenario is that my app mainly used load after which things are go  
> from the
> cache, but sometimes for priority reasons I just fetch a url  
> without load.
> If afterwards I could set the cache to include this new data then I  
> would
> not have to do complex track keeping or reload the url?
>
> Was thinking of looking at the code, and figuring where the cache  
> stuff is -
> pointers or sugestions?

My suggestion would be to set up your own cache system instead. It's  
not too difficult. Use a customPropertySet or script local array to  
store the data, and use the url as the key. Then you just need three  
handlers/functions:

getFromCache <url>
storeToCache <url>
deleteFromCache <url>

Then just use get/post URL, or if you use load, after putting the  
data in your own cache, unload the url.

But if you want to tamper with libUrl, and understand the danger that  
if you get too familiar you may be asked to take it over, and accept  
the usual "at your own risk" warning, and understand that your  
changes may not work in future updates and that you may turn into a  
frog...

... you could probably add a handler to liburl that would need to  
touch 2 script local variables. These are laLoadedUrls and  
laUrlLoadStatus. These are both arrays, and the keys are the relevant  
url itself. Put the data to be cached into laLoadedUrls[yourURL] and  
set laUrlLoadStatus[yourUrl] to "cached".

Kerro kerro
Dave








More information about the use-livecode mailing list