Should anybody encounter the same problem in the future, here are the
answers to my questions, determined empirically:
1. yes; and
2. by using Apple's Application class to register an
ApplicationListener, and setting the shared URL cache from its
handleOpenApplication method.
On 29 Sep 2006, at 14:15, Geoff Levner wrote:
We are using WebKit in a Java application, via JNI, to display HTML
pages.
Since WebKit's brain-dead URL cache mechanism causes it to continue
loading old images even if the image files have changed, I am
trying to disable it. The only way I have found so far is to
intercept resource load requests, via the WebResourceLoadDelegate,
and to change the requests so that they explicitly request that the
cache be ignored. What I would really like to do, though, is
disable the cache altogether.
According to the WebKit documentation, you can replace the default
URL cache with your own, using the NSURLCache setSharedURLCache
method. But doing this seems to have no effect; my cache is never
used. Although the documentation says nothing about this, I figure
I may need to call that method earlier. I already call it before
using any WebKit methods, but maybe it needs to be called as soon
as the application starts up. In a Cocoa app one might, for
example, subclass NSApplication and override the method
applicationDidBecomeActive. But what can you do in a Java app?
So, can anybody tell me:
1. if I am on the right track, that is, if setSharedURLCache needs
to be called earlier; or
2. how I can do this from a Java app?
Thanks,
Geoff
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webkitsdk-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webkitsdk-dev/email@hidden