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: loadHTMLString caching problems



Hi Darin,

In the process of generating the sample code I tracked the problem down - I did not have any problem repeating the bug, but when I tested on the latest system & webkit combo I could see that the bug was fixed.

My problem was that when using loadHTMLString the caching policy in WebResourceLoadDelegate webView:resource:willSendRequest:redirectResponse:fromDataSource delegate is not respected

-(NSURLRequest *)webView:(WebView *)sender
        resource:(id)identifier
     willSendRequest:(NSURLRequest *)request
    redirectResponse:(NSURLResponse *)redirectResponse
      fromDataSource:(WebDataSource *)dataSource
{
  if (![request URL])
    return request;

  if ([request cachePolicy] == NSURLRequestReloadIgnoringCacheData)
    return request;

  if ([[request URL] isEqualTo:fBaseURL])
    return request;

  NSLog(@"changing cache policy for %@", [request URL]);
  return [NSURLRequest requestWithURL:[request URL]
            cachePolicy:NSURLRequestReloadIgnoringCacheData
            timeoutInterval:[request timeoutInterval]];
}


WebKit hangs on to it's cache as if it's very life depended on it. This is fixed in the latest release - i am not sure when it was fixed but it certainly works now


Alan

_______________________________________________
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

This email sent to email@hidden
References: 
 >Re: loadHTMLString caching problems (From: Alan Shouls <email@hidden>)
 >Re: loadHTMLString caching problems (From: Darin Adler <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.