Yogeshwar Khadilkar wrote:
> Is there any component that will return the browser's cache reference.

You can use nsICacheService to create a cache session, and then use 
openCacheEntry to read individual entries. The key for the entry is 
normally the URL of the page (except for POST result pages).

However, even if a cache entry exists, it's possible that attempts to 
load that URL will cause a network access again (if the entry is 
expired, or if certain headers are present).

Another option would be to do the same as the code at 
http://lxr.mozilla.org/seamonkey/source/dom/src/base/nsGlobalWindow.cpp#8776 
(nsNavigator::IsLocallyAvailable), which takes those factors into 
account. (you can do that from JavaScript too).

-christian
_______________________________________________
dev-tech-xpcom mailing list
dev-tech-xpcom@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to