Back button in Safari / Webkit loads a page from the cache instead of a new copy

I'm having problems with the "weird" behavior of Safari / Webkit on Mac OSX systems, which are related to the functionality of the back button when javascript is disabled in the browser.

The script I have is a web application consisting of a login page, which, upon successful login, will lead the user to page1. If the user leaves page 1, he will be redirected to page2. Outside the session, non-authenticated requests to page1 are redirected to the initial login page via the HTTP response 302.

It is also worth mentioning that the responses to requests for page1 contain the following HTTP headers to prevent browsers from caching the page:

Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Expires: Thu, 1 JAN 1970
Pragma: no-cache

After successfully exiting page 1, the user is redirected to page2. If at this moment the user decided to click the "Back" button, the browser will load page1 from its cache and not hit the server to get a new copy. Please, not so that all this happens when javascript is disabled in Safari, after which it ENABLED produces the expected result of reloading page1 from the web server, thereby redirecting the user to the login login page

I tried to set the unload event handler on the page tag tag so that Webkit would not load the page into its page cache, but this did not seem to solve the problem.

Other major browsers, FF, IE and Chrome, seem to give the expected result in both JS and non-JS situations.

Am I missing something, or is it more likely due to an error with Safari / WebKit?

;

0
1

- " " Webkit/Safari. .

iOS 5 Safari /

. , Webkit/Safari pageCache - , .

0

All Articles