0

There is a lot out there about forcing browser cached JS and CSS files to reload, my problem now relies on HTML only. We use cache-manifest to save our HTML and other files on client's browser for offline use.

Our problem is when we update the HTML file (actually a PHP file that outputs HTML).

How can we force client's browser to reload the HTML without telling them to press CTRL+SHIFT+R and other shortcut tricks?

We need to do it automatically or at least forcing users to click a button that will make the browser fetch the new version of the HTML, and save it locally for offline use.

Is it possible? Thank you!

Crash Override
  • 411
  • 6
  • 17

1 Answers1

0

I believe cache-manifest is deprecated, I would recommend to use service worker instead. It will allow you to "force" your users to update every time you want to update your page. Also it will allow them to work offline with your web app. (Plot twist: your page must serve HTTPS)

It may look difficult to master, but there are web pages that can help you to start with service workers or Progressive Web Apps

Lolpez
  • 849
  • 8
  • 17