Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Java and the WebKit URL cache



Hi Geoff,

You may want to ask webkitsdk-dev; your use of Java should not affect the correct answer whatever it may be.

The answer to #2 would be to do it from handleOpenApplication, the EAWT event sent when applicationDidFinishLaunching is called on the NSApplication delegate.   I don't know if that's actually what you're missing though.

md

----------------------

Matt Drance

DTS Engineer

email@hidden



On Sep 29, 2006, at 5:04 AM, 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.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden

References: 
 >Java and the WebKit URL cache (From: Geoff Levner <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.