Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete File from client's cache

Status
Not open for further replies.

mlowe9

Programmer
Apr 3, 2002
221
0
0
US
I apologize for starting a second thread, but I quit getting responses on my other, and this cannot be that hard.

Basically, I want to be able to delete a file from the client's cache. I cannot set the page to "no-cache" because they must be able to cache it momentarily.

I have been able to accomplish this by overwriting the file with another by the same name, but it's not a very good way to do it, there has to be a better way. Please, help will be very very appreciated. I have spent way too long trying to figure this out...

thank you
 
Can't you set the cache to expire in certain time period, say in a few days or perhaps even hours ?
 
I tried that, but the file stays in the Temporary Internet Files folder, even after it expires. It just shows as expired. I'm guessing the browser won't pull it if it's expired, even though it's still there.

I found a solution, although I'd like to find a better way if there is one. I have two files

Code:
<html>
  <body>
    <form name=this_form method=post action=Test2.asp target=util_frame>
    <input type=hidden name=WhatToDo>
    </form>

    <script language=javascript>
      this_form.WhatToDo.value='createfile'
      this_form.submit()
      this_form.WhatToDo.value='overwritefile'
      setTimeout("this_form.submit()",3000)
    </script>
  </body>
</html>

and

Code:
<%
WhatToDo = request.form("WhatToDo")
if WhatToDo = "" then
  WhatToDo = "createfile"
end if

if WhatToDo = "createfile" then
  response.expires = 1

  response.contenttype = "application/x-ica"
  response.write "; ICA File created by ASP" & vbcrlf

  response.write "[WFClient]" & vbcrlf
  response.write "TcpBrowserAddress=citrixserver" & vbcrlf
  response.write "Version=2" & vbcrlf

  response.write "[ApplicationServers]" & vbcrlf
  response.write "AppName=" & vbcrlf

  response.write "[AppName]" & vbcrlf
  response.write "WinstationDriver=ICA 3.0" & vbcrlf
  response.write "TransportDriver=TCP/IP" & vbcrlf
  response.write "Address=PubAppName" & vbcrlf
  response.write "Username=username" & vbcrlf
  response.write "Password=" & vbcrlf
  response.write "ClearPassword=userpassword" & vbcrlf
  response.write "Domain=userdomain" & vbcrlf
  response.write "InitialProgram=#PubAppName" & vbcrlf

  response.write "DesiredColor=8" & vbcrlf
  response.write "DesiredHRES=1280" & vbcrlf
  response.write "DesiredVRES=1024" & vbcrlf
  response.write "DesiredWinType=8" & vbcrlf
  response.write "TWIMode=On" & vbcrlf

  response.write "EncryptionLevelSession=EncRC5-128" & vbcrlf

elseif WhatToDo = "overwritefile" then
  response.expires = 1
  response.addheader "pragma","no-cache"
  response.addheader "cache-control","private"
  response.cachecontrol = "no-cache"

end if

%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top