Ilia Choly
Ilia Choly

Reputation: 18557

prevent firefox page state caching

How do i prevent firefox from caching page state? I'm developing a web app and firefox is automatically setting previously checked checkboxes without triggering any events. Is there a way to prevent firefox from doing this or do I just have to reset my entire ui on startup with js?

Upvotes: 2

Views: 913

Answers (2)

nwellcome
nwellcome

Reputation: 2299

You can add autocomplete="off" to the afflicted fields, MDN Document. If that doesn't work and you can use jQuery I would go with $(form).reset() on page load as an easy fix.

Upvotes: 3

Rusty Jeans
Rusty Jeans

Reputation: 1426

You'll probably need to set the HTTP Expires header to be expired, that way Firefox won't cache the page, it'll go back to the server.

In PHP you can do this by calling:

  header("Expires: 0");

Upvotes: 1

Related Questions