1

I'm using aUIWebView to load a url with go back feature.

For example, "Url1 = www.google.com."

If I clicked any inter link like Images, Videos then those page will be displayed. Again if I pressed google.com then it will load google page.

Now my UIWebView cached urls are like, google, images, videos.

What I want is, I want to clear my cache when loads the url1 again. It shouldn't have any back to go.

Can anyone suggest me how to achieve this?

I've tried to remove the cache using this,

[[NSURLCache sharedURLCache] removeAllCachedResponses];

But It's not working.

Vijay
  • 791
  • 1
  • 8
  • 23

1 Answers1

-1

For removing cached response for a perticular request use this

[[NSURLCache sharedURLCache] removeCachedResponseForRequest:NSURLRequest]; 

For removing cached response for all requests ran on the UIWebView use this

 [[NSURLCache sharedURLCache] removeAllCachedResponses];
Nikita Khandelwal
  • 1,741
  • 16
  • 25
  • duplicate of my answer on http://stackoverflow.com/questions/30258345/local-html-cache-policy-in-uiwebview/30258520#30258520 – Ashok Londhe May 21 '15 at 12:24