0

I have a page with a checkbox and a link to page A.

I click on the checkbox, I click on the link, go to page A, click browser back button, come back

I still see the checkbox checked, it's not clearing up.

I have used proper cache-control headers as below.

Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-store, no-cache
Expires: 0

Also, tried this:

document.body.onunload = function(){};
    document.body.onpageshow = function(evt) {
        if (evt.persisted) {
        document.body.style.display = "none";
        location.reload();
        }
    };

Nothing works in chrome and safari (desktop)

Works well on IE, Firefox, mobile chrome and safari.

Please help.

snehatulsi
  • 251
  • 1
  • 12
  • The persistent cache is probably not used. However, the in-RAM cache may still be active as the page wasn't evicted from memory during the navigation process. – Paul Stelian Jul 12 '16 at 12:55
  • i need to refresh the page. what should i do to force it? also in network tab, the DOCUMENT is not fetched from cache, i can verify that. But the form is not cleared. – snehatulsi Jul 12 '16 at 13:00
  • for safari, adding below solved the problem: – snehatulsi Jul 12 '16 at 13:13

1 Answers1

0

This seems to be the same problem as Why does the checkbox stay checked when reloading the page?

What worked for me was to add autocomplete="off" into the form element on the page.

Community
  • 1
  • 1