Page 2 of 2 FirstFirst 12
Results 11 to 11 of 11

Thread: Clear Browser Cache with Javascript?

  1. #11
    Join Date
    Mar 2006
    Illinois, USA
    Thanked 690 Times in 678 Posts


    First, this discussion is three years old. Second, if you are just signing up to complain without any counterexamples then that's not productive. Third, if you do manage to find a complicated way around this, then as soon as you do the browsers will begin to block it as a security risk. This should not be allowed, and if it were it would be dangerous and would need to be blocked. Also, please read an entire discussion before misquoting us. For example, see this post:
    Quote Originally Posted by djr33
    Security issue and completely impossible, but it might be possible to solve the problem another way, or attach a no-cache header for a page that must reload each time, etc. Once it is on the computer, though, nothing can be done, at all, short of invading the computer with ActiveX or a Java applet, at which point you could just as easily rename their C drive as delete their cache.
    Though this is a three-year-old discussion, I don't believe anything has changed.

    You can't compile assembly language inside of Javascript. For one thing, Javascript does not "compile"-- it is delivered directly and executed within the browser as code. In that sense it's not the same as other programming languages that are compiled. It's just code-- that's why it's called Javascript.

    And again, even if you manage to do this you'll be creating many problems by opening such security risks. We can only hope that the browsers are smart enough to block any potential security risks like that. In fact, I think it's so likely it doesn't seem worth the effort looking for the holes, but go ahead if you'd like.

    More generally, this would be possible if it were not blocked. I don't disagree with you. It might even be useful. But it's not allowed, and it shouldn't be because of the potential consequences-- and I personally don't want a website messing with cached files on my computer.
    And even if there is a way to do this, then it would either be hacking (and quickly, I hope, blocked by the browsers) or allowed in the security settings. It also would vary by browser and by system, so while it might be possible to do this on some systems/browsers (probably with the user's permission), it would not always work-- what about users on Mac or Linux OS? Or if you did use ActiveX then what about non-IE browsers? Etc.

    This doesn't mean there is no solution to the original problem, but it needs to be approached in a different way.

    As for the idea of not posting negative comments, I don't agree. If someone is asking a question about something that is not possible, then it is HELPFUL to tell them it is not possible so they don't waste their time. Of course "not possible" must be understood in the context of "within the current status of technology", but effectively, yes, this IS impossible.
    Last edited by djr33; 06-30-2011 at 08:02 PM.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts