Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to renew the value stored in Cache (Asp.net 1.1)

How to renew the value stored in Cache (Asp.net 1.1)

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netwindows-adminhelptutorial
7 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Bluebamboo
    wrote on last edited by
    #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

    A B 2 Replies Last reply
    0
    • B Bluebamboo

      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

      A Offline
      A Offline
      AlexeiXX3
      wrote on last edited by
      #2

      What happens if you just write: cache ("key") = "New email content" Why would you need to restart iis?

      Alexei Rodriguez

      B 1 Reply Last reply
      0
      • A AlexeiXX3

        What happens if you just write: cache ("key") = "New email content" Why would you need to restart iis?

        Alexei Rodriguez

        B Offline
        B Offline
        Bluebamboo
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • B Bluebamboo

          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

          B Offline
          B Offline
          Bluebamboo
          wrote on last edited by
          #4

          I just found that the cache can be emptied if any changes happened on Web.config :omg:

          A 1 Reply Last reply
          0
          • B Bluebamboo

            I just found that the cache can be emptied if any changes happened on Web.config :omg:

            A Offline
            A Offline
            AlexeiXX3
            wrote on last edited by
            #5

            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

            B 1 Reply Last reply
            0
            • A AlexeiXX3

              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

              B Offline
              B Offline
              Bluebamboo
              wrote on last edited by
              #6

              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

              A 1 Reply Last reply
              0
              • B Bluebamboo

                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

                A Offline
                A Offline
                AlexeiXX3
                wrote on last edited by
                #7

                Im not sure if you can use this in 1.1 Take a look at CacheDependency Add you email file as a cachedependency Ass soon as you change that file, the cache item will be removed from the cache

                Alexei Rodriguez

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups