Thanks Doug very useful.  Will definitely keep that to test when the
new version comes out, or if time permits me to check out the
nightlies.

Going to my pedantic side - I think there's a redundant line of code
in there: var test = files[0]; in the browse function.

Cheers

Chris

On Nov 10, 8:45 am, Douglas Mayle <[EMAIL PROTECTED]> wrote:
> I was just playing around with one of the demos to see how it would  
> work.  The code isn't too useful, but it captures blobs that you can  
> then test out by manually selecting the URL in the browser... I've  
> attached it here...
>
> Doug
>
>  hello_world_resourcestore.html
> 5KViewDownload
>
>
>
> On Nov 8, 2008, at 6:18 PM, Dave wrote:
>
>
>
> > Makes sense...and then presumably I'd just set the src attribute of
> > the Image object to my special URL? Keeping a separate array so I know
> > which things to free seems pretty straightforward.
>
> > The only problem is that this blob technique is new enough not to be
> > in the documentation yet, so (particularly as someone new to Gears)
> > I'm not sure how to "invent yourself some (hopefully) unique URL,  and
> > then request that the LocalServer cache it, giving it the blob." Can I
> > trouble you for a code snippet or two (including how to free it up if
> > that's not straightforward)?
>
> > Thanks!
>
> > On Nov 8, 2:35 pm, Douglas Mayle <[EMAIL PROTECTED]> wrote:
> >> captureBlob requires the nightlies...  You can search in this group  
> >> to
> >> find a reference.  You invent yourself some (hopefully) unique URL,
> >> and then request that the LocalServer cache it, giving it the blob.
> >> Once you've done that, you can access like any other remote document,
> >> except that it doesn't need a request to the remote server.
> >> Unfortunately, LocalServer doesn't give you any way to enumerate the
> >> captured URLs, so you'll have to keep track of that yourself, perhaps
> >> with a database.  To make it easier, you can keep them grouped in
> >> silos by using the named stores.
>
> >> On Nov 8, 2008, at 2:37 PM, Dave wrote:
>
> >>> I don't see anything about captureBlob() in the API docs for Gears.
> >>> Would I need do download a nightly or something to get it? What
> >>> additional step is required to create a reference, or does
> >>> captureBlob() keep one?
>
> >>> More generally, does anyone have an example?
>
> >>> Also, how will I know when disk space is getting full and clean-up  
> >>> is
> >>> required? Or do I just need to guess based on average image size and
> >>> number?
>
> >>> On Nov 8, 1:21 am, Khookie <[EMAIL PROTECTED]> wrote:
> >>>> Chris,
>
> >>>>> In that case I would just fetch the Blobs, and keep a reference so
> >>>>> they don't get garbage collected.
>
> >>>> Wouldn't the blobs need to be captured with
> >>>> ResourceStore.captureBlob(...) before you can view them as images
> >>>> through DOM manipulation or a straight <img> tag?
>
> >>>> And also, I assume that anything captured with captureBlob(...) can
> >>>> be
> >>>> removed with remove(...) when the blob isn't required anymore?  
> >>>> That
> >>>> way, Dave can create his image caching slideshow.
>
> >>>> Cheers
>
> >>>> Chris
>
> >>>> On Nov 8, 1:59 pm, Chris Prince <[EMAIL PROTECTED]> wrote:
>
> >>>>>> Thanks. So is there a better way to do this in Gears? Again, I'm
> >>>>>> running a changing slideshow with lots of images in it. The page
> >>>>>> won't
> >>>>>> refresh very often but will pull in new images periodically.
> >>>>>> Keeping
> >>>>>> them all in memory is probably a bad idea so I want to cache them
> >>>>>> on
> >>>>>> disk...but as that cache gets big I'll need to prune it
>
> >>>>> Oh, so you plan on being connected?  And you are mostly interested
> >>>>> in
> >>>>> caching, rather than persisting the data across browser sessions?
>
> >>>>> In that case I would just fetch the Blobs, and keep a reference so
> >>>>> they don't get garbage collected.
>
> >>>>> For in-session caching, I wouldn't worry too much about whether  
> >>>>> the
> >>>>> representation is in-memory or on-disk.  You should be able to
> >>>>> rely on
> >>>>> Gears and the operating system to Be Smart About It (tm).
>
> >>>>> FWIW, there was a discussion about automatically spilling large
> >>>>> Blobs to 
> >>>>> disk.http://groups.google.com/group/gears-eng/msg/d589bd81968561ee
>
> >>>>> And even without that, the OS will spill to the user's paging file
> >>>>> as
> >>>>> needed.  You should get the effect you want today.
>
> >>>>> Are you not seeing that?
>
> >>>>> --Chris

Reply via email to