Developer
Developer

Reputation: 474

Full Hard refresh of page - Ctrl+shift+r

I would like to know how to implement a "ctrl+shift+r" command into my HTML page. I can use javascript or html.

It should be run only when people click in a link

I tried these points

location.reload(true);
window.location.reload(true);

but this steps not workings

Any idea how to implement this?

Thanks.

Upvotes: 0

Views: 6117

Answers (1)

Synapsis
Synapsis

Reputation: 1017

There are a lot of ways of doing that. One of the ways that worked for me was adding these meta tags

<meta http-equiv='cache-control' content='no-cache'>

<meta http-equiv='expires' content='0'>

<meta http-equiv='pragma' content='no-cache'>

You can also do that using that function:

function deleteItems() {
  localStorage.clear();
}

this will delete the local storage of the web page

Another way of doing that is by using this function:

caches.delete(cacheName).then(function(boolean) {
  // your cache is now deleted
});

If that doesn't work let me know in the comments, I have plenty of ways of doing that.

Upvotes: 2

Related Questions