0

When the website goes live from local we have to press F5 to reload the web page. Can we give idea to clear cache while loading website? Is there any jQuery or JavaScript for hard refreshing a website?

Cœur
  • 37,241
  • 25
  • 195
  • 267

2 Answers2

1

Look into the cache-control and the expires META Tag.

Another common practices is to append constantly-changing strings to the end of the requested files. For instance:

<script type="text/javascript" src="main.js?v=12392823"></script>

Another Example

Community
  • 1
  • 1
Mayank Pandeyz
  • 25,704
  • 4
  • 40
  • 59
0

Use:

location.reload(true);

This will reload the page from the server. Do your research! (Javascript hard refresh of current page).

Community
  • 1
  • 1