Re: Original DOM of a XSLT'd XML

Christian Biesinger <[email protected]>
Newsgroups gmane.comp.mozilla.devel.xml
Message-ID <[email protected]>
r0wb0t wrote:
> Ok, great!  So my follow-up question is: How can I tell
> XMLDocument.load to only use the cache or else abort?  Or even better,
> to tell if a certain URL will be taken from the cache before I call
> load.

I don't think you can do either. Hm... you could use the cache APIs to 
check whether a certain URL is in cache, but you'd also have to verify 
that it's not expired of course. This would be around nsICacheService 
(the "key" is the URL, basically, at least for GET requests)

What you could also do is use lower level necko APIs and set the 
LOAD_ONLY_FROM_CACHE load flag. That ensures that the server won't be 
contacted. Maybe you can also use that together with XMLHttpRequest 
(after .open() and before .send(), do req.channel.loadFlags |= 
Components.interfaces.nsICachingChannel.LOAD_ONLY_FROM_CACHE. but I'm 
not sure whether this will work)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.