Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

How to Clear Browser Cache in Javascript?

s0crates9 (TechnicalUser) (OP)
22 Apr 06 17:49
Hi everyone.

I've got a unique question. Is there a command or way to clear the browser cache onclick? I would like to apply a button on a test page that can clear browser cache from IE, Firefox, Netscape, etc.

Any assistance in this would be awesome. I suspect there is a way since in Javascript you can add bookmarks and other browser functions...

Thanks!

Web site design, internet marketing, SEO and business solutions company.
http://www.startegy.net
http://www.dominus-web.com
http://websitedesigncompany.blogspot.com/

mbrooks (Programmer)
22 Apr 06 18:30
No..  Due to security setting on the browser this is impossible.
Imagine how something like this can be abused.

M. Brooks
http://mbrooks.info

BillyRayPreachersSon (Programmer)
23 Apr 06 4:38

You can probably do this in IE using the FileSystemObject to delete all the files in a specified folder, but that would assume that you know where every user who visits your site has their cache folder.

Other than that, I doubt this can be done.

Dan


Dan's Page @ Code Couch
http://www.codecouch.com/dan/


s0crates9 (TechnicalUser) (OP)
23 Apr 06 21:03
Thanks Guys. I figured it might be a security risk for users online, but thought that there would be a way to acocomplish it within a trusted infrastructure as in an "intranet" application.

Web site design, internet marketing, SEO and business solutions company.
http://www.startegy.net
http://www.dominus-web.com
http://websitedesigncompany.blogspot.com/

ggriffit (Programmer)
24 Apr 06 5:32
If it is an intranet, then you may be able to set the HTTP Header so it does not cache - http://www.htmlgoodies.com/beyond/reference/article.php/3472881


Greg Griffiths
Livelink Certified Developer & ECM Global Star  Champion 2005
http://www.greggriffiths.org/livelink/

theniteowl (Programmer)
24 Apr 06 12:55
s0crates9, is your company IE only?
You could use ActiveX to clear out the folders and use system variables to determine the path to the temporary internet files folder for the current logged on user.  The ActiveX will cause warnings to the user though.

Paranoid?  ME??    Who wants to know????

s0crates9 (TechnicalUser) (OP)
24 Apr 06 22:05
theniteowl,

That is actually a great idea, but I dont' know anything about creating activex controls to do this. Do you know of any easy to follow tutorials on this?

Web site design, internet marketing, SEO and business solutions company.
http://www.startegy.net
http://www.dominus-web.com
http://websitedesigncompany.blogspot.com/

BillyRayPreachersSon (Programmer)
25 Apr 06 2:42

Perhaps searching Google for the information I gave in my first post ("FileSystemObject") would throw some results up..

Dan

Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page @ Code Couch
http://www.codecouch.com/dan/


theniteowl (Programmer)
25 Apr 06 7:58
You do not need to create the ActiveX controls only to use ones included with IE.  The FileSystemObject BillyRayPreachersSon mentioned above is one such object and exactly the one you need for accessing the file system of the local PC.  It gets invoked with a command like:
var fso = new ActiveXObject('Scripting.FileSystemObject');

Most of your examples for using FileSystemObject will be in VBScript but you can find some searching for Javascript and more searching for JScript.
Then you need to search for info on Windows environment variables.  I do not know if there is one specifically for the Temporary Internet Files folder but something like %APPDATA% get's you close in  Win 2000 system.  From there you have to back up one folder then go into Local Settings/Temporary Internet Files.  There may be other more direct variables and what you use may depend on what version OS you are dealing with.

Paranoid?  ME??    Who wants to know????

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close