How to clear the IE 10 and 11 cache via a javascript function?

Asked

Viewed 39 times

0

How to clean the cache IE via a javascript function?

I want every time you click on a particular button, run a function that cleans the cache of IE 10 and 11.

I used:

function atualiza() {
    setTimeout(function () { window.location.reload(true); }, 3000);
}

<button ng-click="editar()" type="button" class="btn btn-primary btn-md atualizar-edicao" data-dismiss="modal" id="" onclick="atualiza()">
   <span class="glyphicon glyphicon-ok-sign"></span> Salvar
</button>

But he doesn’t clean the cache.

  • How is your button?

  • @bigown I added details to the question

  • You can’t clean the cache code browser

  • @Serious Brunocosta? There’s no way to force this?

  • 1

    The @Brunocosta is right, if desire does not give, it would be a huge security breach. If you just want your page to be reloaded guaranteed from the server and not from the cache, just improve this code a little and should already be right. Resign yourself to that.

  • @bigown this is a temporary solution, I will not let this solution implemented. These are tests I am applying. What I need right now is to force the cash cleaning, because when I give refresh, it does not have the expected behavior, now when I give the crtl+shift+del and clean the cash, it works correctly. When I give only this command, it keeps keeping the cash, and does not update the changed information

  • @bigown is that I only have the expected result, when clean cash, but if you have any way to force this update, also serve, I’m accepting suggestions..

  • So fix the error that is preventing the expected result, do not gambiarra, that lucky nor can.

  • @Mustache if I knew how to fix it would have solved for sure. You said that "just make sure your page is reloaded from the server and don’t take it from the cache" how do I do that? you can demonstrate?

  • If the problem is the cache, then disable it.

Show 5 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.