Re: Image Cache

Greg Bowyer <[email protected]> Fri, 27 Jul 2007 13:35:48 +0100
Newsgroups gmane.comp.mozilla.devel.java
Message-ID <-uqdnVx9ko_3ejTbnZ2dnUVZ_jOdnZ2d__45337.4752695256$1185540036$gmane$org@mozilla.org>
XulPlanet turns up this

http://www.xulplanet.com/references/xpcomref/ifaces/nsICacheService.html

with reference to  void visitEntries ( nsICacheVisitor visitor )
This may be in the ballpark of what you want, there is also the prefetch 
service

http://www.xulplanet.com/references/xpcomref/ifaces/nsIPrefetchService.html


Michal Ceresna wrote:
> On Friday 27 July 2007, [email protected] wrote:
> Hi Richard,
> 
>> Does anyone know if it is possible (and if so how to) access the
>> browser cache (specifically the images) via JavaXPCOM, I have the
>> bowser instance up and running and am able to use it to open pages
>> etc.  I need to do some processing on the images of a page.  The
>> filenames of the images for the current page would be ideal so that i
>> can load this file in my Java code and use it from there.
> If you want to browse the browser cache, the easiest way is
> using the url about:cache
> 
> Afaik, the image data is not accessible over scriptable
> interfaces (javaxpcom).
> 
> Therefore also code such as 'Save Pase As' re-downloads all 
> images again. Of course, in most cases it obtains cache hits 
> because the page with images was already loaded.
> 
> regards,
> Michal