title: how to remove old applet from browser's cache programmatically?
body: <p>Is there a way to delete older version of an applet from browser's cache? The things I have already tried to prevent the <a href="https://stackoverflow.com/questions/7661008/force-browser-to-reload-applet-everytime">cache problem</a> in first place are:</p>
  
  <p>1- To set "no-cache" in HTTP response header, I placed following script on the top of my jsp:</p>
  
  <pre><code>&lt;% 
  if (request.getProtocol().compareTo("HTTP/1.0") == 0) {
              response.setHeader("Pragma", "no-cache");
          } else if (request.getProtocol().compareTo("HTTP/1.1") == 0) {
              response.setHeader("Cache-Control", "no-cache");
          }
          response.setDateHeader("Expires", 0);
  %&gt;
  </code></pre>
  
  <p>2- While deploying applet <code>'cache_option'</code> is set to <code>'no'</code></p>
  
  <p>But of no use. I was now wondering if there is a way to programatically delete this applet jar file from cache?</p>
  
  <p><b>[UPDATE]</b></p>
  
  <p>Providing a unique url for applet each time doesn't look like a good idea in my case. As, in my case applet reloads(refresh) itself after a time (say at mid-night, using <a href="http://download.oracle.com/javase/1.4.2/docs/api/java/util/Timer.html" rel="nofollow noreferrer">Timer</a>), hitting on a url </p>
  
  <pre><code>applet.getAppletContext().showDocument(url); 
  </code></pre>
  
  <p>It would be difficult to communicate new url to applet</p>