Can anyone tell me how to delete the browser cache using javascript? I want this because I am giving the user the file to download with the URL ('http://www.example.com/docs/doc1.xlsx'). And this file is only available for that specific user.
I am checking the HTACS redirect which redirects to that specific file URL, if the user is not using the Access denied page.
But the problem occurs when a valid user downloads and logs out of the file and copies over the URL and the browser enters the file, for download without access to the server. Which is caused by caching in the browser.
Then I want to delete the cache when the user logs out from the system.
The alternative solution is most welcome.
In short, you (or, at least, I have never seen any way to do this) can not do.
You have to do it on the server and by sending the correct cache-busted headers something like this:
Cache-control: no-cache, re-modified, max-age = 0
You can do this (for example to steal):
header ("Cash-Control: No-Cash, Sure-Modified , Max-age = 0 "); Header ("End: Saturn, 26 July 1997 05:00:00 GMT");
Comments
Post a Comment