Search code examples
browsercachinghttp-headersbrowser-cache

Browser Cache: If we change something force user to get new version, not local cached version


We make changes often on our website (which uses caching) and sometimes user don't know to refresh a page in order to get the newest copy of it.

If we do update a page, how can we force the users browser to know that there is a new server version, and to use that rather than their browsers cached page?


Solution

  • Either you can set an http header to force reload every n'th second. That's the easy way, but you probably don't want this. The second way is to use a javascript asking the server via ajax if there is an update. If so, force a reload.

    About the cache, you can set an expire header on the page.