Clear Cache (SOLVED)

mkb1967

New member
Hello,
I would like a script that clears cache when exiting a publication, but I don’t know anything about scripting. Can someone please write that for me here?

Thanks
 
Last edited:
This function exists (HEScript built-in function), it is called ClearIECacheOrHistory
Lets you clear the IE’s cache (Temporary Internet Files) or the IE’s history.

procedure ClearIECacheOrHistory(ClearCache: Boolean);
  • ClearCache: True to clear the cache or False to clear the history.
See http://www.htmlexe.com/help/scriptreference.htm
 
Last edited:
“gdgsupport” said:
This function exists (HEScript built-in function), it is called ClearIECacheOrHistory
Lets you clear the IE’s cache (Temporary Internet Files) or the IE’s history.

procedure ClearIECacheOrHistory(ClearCache: Boolean);
  • ClearCache: True to clear the cache or False to clear the history.
See http://www.htmlexe.com/help/scriptreference.htm
http://www.htmlexe.com/help/scriptreference.htm[/quote]

Thanks, how do I write the “true” part? I don’t know anything about scripting at all.
 
Last edited:
Hi,
Could you please type the procedure to clear the cache exactly as I would need to enter it in the script manager?
 
Last edited:
Edit the UserMain script, locate OnPubBeingClosed in the script and replace the three lines by:
Code:
procedure OnPubBeingClosed;
begin
 // When the publication is going to be closed.
 ClearIECacheOrHistory(True); 
end;
 
Last edited:
“gdgsupport” said:
Edit the UserMain script, locate OnPubBeingClosed in the script and replace the three lines by:
Code:
procedure OnPubBeingClosed;
begin
 // When the publication is going to be closed.
 ClearIECacheOrHistory(True); 
end;

Thanks for replying. I had tried that already and got this error message:

Admin Cue Cards
Script Runtime Error (at -1:0) in :
Cannot Import CLEARIECACHEORHISTORY.

Thanks,
Mike
 
Last edited:
Yes, HTML Viewer publications don’t use the IE cache, they store nothing on the hard disk because everything is temporarily stored in the memory. Thus, there is no function to clear a cache because there is no cache.
ClearIECacheOrHistory will work only for IE publications.
 
Last edited:
“gdgsupport” said:
Yes, HTML Viewer publications don’t use the IE cache, they store nothing on the hard disk because everything is temporarily stored in the memory. Thus, there is no function to clear a cache because there is no cache.
ClearIECacheOrHistory will work only for IE publications.

Okey doke, thanks. Can you think of anything else that will accomplish this:

I’ve set up a security profile that password protects certain pages. I set it up to cache the password so that the user won’t have to enter the password every time he goes to the page. However, I want the cached password to be cleared when he closes the pub so that he will have to enter the password again once every time he opens the file.

Can that be done?
 
Last edited:
I see now what is the “cache” you want to clear. I believe that you used the code at http://www.htmlexe.com/help/samplescript2.htm. If you stored the password in a global variable (named “CachePassword1” in the sample), then use this code to clear it when the program closes:
Code:
procedure OnPubBeingClosed;
begin
// When the publication is going to be closed.
SetGlobalVar("CachePassword1", "", True);
end;
or when you store the password, change SetGlobalVar(“CachePassword1”, S, True); to SetGlobalVar(“CachePassword1”, “”, False);
Thus, the program won’t store the password and ask it again the next time it runs.
 
Last edited:
Back
Top