How to renew the value stored in Cache (Asp.net 1.1)
-
Hi guys, I try to use Cache to store email's content which is used frequently throughout whole Web application, The email was designed to put into a htm file, everytime when the application send email the system will read from the htm file, so the Cache is going to reduce some of IO overhead.
Cache("LINKASCHOOLEMAIL") = "emaill content"
But the problem is if I want to change the content of the email, the changes won't be reflected to cache until I reboot IIS (I can't do in this way because there are several Web applications in that IIS). So is it any ways to resolve my problem? Many thanks Ming -
Hi guys, I try to use Cache to store email's content which is used frequently throughout whole Web application, The email was designed to put into a htm file, everytime when the application send email the system will read from the htm file, so the Cache is going to reduce some of IO overhead.
Cache("LINKASCHOOLEMAIL") = "emaill content"
But the problem is if I want to change the content of the email, the changes won't be reflected to cache until I reboot IIS (I can't do in this way because there are several Web applications in that IIS). So is it any ways to resolve my problem? Many thanks Ming -
What happens if you just write: cache ("key") = "New email content" Why would you need to restart iis?
Alexei Rodriguez
because only when IIS is restarted, the cache can be emptied. The reason I want to renew the cache is I want the changes on email being able to be reflect to cache.
'Save email to cache If Cache("LINKASCHOOLEMAIL") Is Nothing Then Cache("LINKASCHOOLEMAIL") = "Read email from file" End If
Many thanks -
Hi guys, I try to use Cache to store email's content which is used frequently throughout whole Web application, The email was designed to put into a htm file, everytime when the application send email the system will read from the htm file, so the Cache is going to reduce some of IO overhead.
Cache("LINKASCHOOLEMAIL") = "emaill content"
But the problem is if I want to change the content of the email, the changes won't be reflected to cache until I reboot IIS (I can't do in this way because there are several Web applications in that IIS). So is it any ways to resolve my problem? Many thanks MingI just found that the cache can be emptied if any changes happened on Web.config :omg:
-
I just found that the cache can be emptied if any changes happened on Web.config :omg:
-
I think im missing something I dont get it Why cant you just change the value of a cache element?? Doesnt 1.1 have this method?
Cache.Remove("Key")
Alexei Rodriguez
Thanks Alexei, Image that when I tried to deploy another version of application, which the email content(physical file) used by application has been updated, but the code still reads old value from cache instend of the new email file because cache("key") is not Nothing. Ming
-
Thanks Alexei, Image that when I tried to deploy another version of application, which the email content(physical file) used by application has been updated, but the code still reads old value from cache instend of the new email file because cache("key") is not Nothing. Ming