ios - Clean cached network request in WKWebView -


how lean cached network request in wkwebview? cached request, want keep cookies , assets.

i've tried removing in wkwebsitedatastore.defaultdatastore besides wkwebsitedatatypecookies

let websitedatatypes = nsset(array: [         wkwebsitedatatypeofflinewebapplicationcache,         wkwebsitedatatypediskcache,         wkwebsitedatatypememorycache,         wkwebsitedatatypesessionstorage,         wkwebsitedatatypelocalstorage,         wkwebsitedatatypewebsqldatabases,         wkwebsitedatatypeindexeddbdatabases     ])  let date = nsdate(timeintervalsince1970: 0) wkwebsitedatastore.defaultdatastore().removedataoftypes(websitedatatypes as! set<string>, modifiedsince: date, completionhandler:{ }) 

didn't work, wkwebview still using cached request on swipe back. i've tried

nsurlcache.sharedurlcache().removeallcachedresponses() 

which didn't work either.

edit

forgot mention, setting cache policy request won't work, app cache policy valid initial request , further request cache policy based on cache policy in response headers. more info: https://forums.developer.apple.com/thread/53573

give try way

var request = urlrequest(url: yoururl) //..... request.cachepolicy = .reloadignoringlocalcachedata 

Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -