Skip to content

Latest commit

 

History

History
34 lines (26 loc) · 1.02 KB

File metadata and controls

34 lines (26 loc) · 1.02 KB

Reload a Page

Use the history go() method.

<form>
  <input type="button" onClick="history.go(0)" value="Refresh" />
</form>

Alternatively, you can use cache control.

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

Set using Java or Node.js:

response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // HTTP 1.1.
response.setHeader("Pragma", "no-cache"); // HTTP 1.0.
response.setHeader("Expires", "0"); // Proxies.

References

  1. Reload From A User’s Click
  2. History go() Method
  3. History.go() (MDN Web Docs)
  4. Reload a Page (JSFiddle)
  5. How do we control web page caching, across all browsers?
  6. Force browser to reload index.htm