On 9 Nov, 15:23, Boris Zbarsky <[EMAIL PROTECTED]> wrote: > Nick Peirson wrote: > > I've tried using prefetchURI, however when navigating to the > > prefetched URI, the page still takes a few seconds to load. Using > > prefetchURIForOfflineUse, the page is cached and is displayed > > immediately. > > Is this a no-store page or some other page that prefetchURI just > wouldn't cache?
My extension tries to prefetch the next image in a sequence, e.g. on browsing to http://www.example.org/1.jpg it tries to prefetch and cache http://www.example.org/2.jpg. Using prefetchURIForOfflineUse means browsing to 2.jpg is already cached, where as with prefetchURI it isn't and 2.jpg loads incrementally when it's browsed to. When testing it I've checked that the http cache headers aren't stopping it being cached, and that it's not expiring from cache immediately, so I'm not sure why prefetchURI doesn't seem to cache the URI in the same way that prefetchURIForOfflineUse does. > > Is there an alternative method to, the now deprecated, > > prefetchURIForOfflineUse that prefetches and places a URI in the > > offline cache? > > There's having an offline manifest with the page... Or perhaps using > nsIOfflineCacheUpdate directly. As this is an extension, I'm not in control of having a manifest on the page. nsIOfflineCacheUpdate sounds like it might do what I need, I'll look into it. > > Is there any possibility of getting the method > > reinstated, as the methods it's been deprecated for, > > nsIOfflineCacheUpdateService, apply to offline applications, rather > > than caching individual URIs? > > The offline cache as a whole applies to offline applications, rather > than individual URIs. > > Setting followup to .network, where hopefully dcamp will see this thread. Thanks for the response and for directing it towards the right person. I realise that this may not be the purpose that the offline cache was originally intended for, however the functionality seems to be popular with users. I've used the extension myself for a long time and having put the extension in the AMO sandbox it's got over 100 users in a couple of days. The prefetching aspect is the main differentiating point from other similar addons and it would be a shame to not be able to keep this feature when Firefox 3.1 is released. Thanks Nick _______________________________________________ dev-tech-network mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-network
