using history.back() in UIWebView but loaded pre page contains very old data

IOS 8.0+


My app use UIWebview to visit a forum site. The forum front page contains two tag: default one is 'Recommend', another one is 'Newest'. Using ajax to load post data When user switch to 'Newest' tag, at the same time the page runs the follow codes to save state:


window.history.pushState(null, title, url);


After that if user is interesting with some post, he/she would click link and jump to a new page to view detail of the post. In this page, I use follow code to let user have a way to go back to 'Newest':


history.back(-1);


Now interesting thing happened, go back to 'Newest' tag but post data is very very old.


After some tests, I found the data is always be the first time loaded after installed the app.This bug will not happen in Safari or Android app.

I believe it should have some relationship with webView cache.But why UIWebview does't use newest cache? And how to solve this problem?

using history.back() in UIWebView but loaded pre page contains very old data
 
 
Q