4 Replies Latest reply on Nov 17, 2008 12:24 AM by Newsgroup_User

    Application.cfc cached.

      As I was writing on another post on this forum regarding my new project deployment, I have a another problem with my Application.CFC, in my project I share some global variables and document paths across the application through Application.cfc variables. but the problem is I mistakenly ran the project with my local settings which is not valid on live server, then the those setting got cached on the server. now even I uploaded the correct Application.cfc with correct settings it's still running on previous wrong settings.. what can I do about this, same happen to my local dev server but when I restart the CF service from my services console, new changes get effected immediately my live server is runs on Linux Apache server.
        • 1. Re: Application.cfc cached.
          Level 7
          they are not cached. it is just that onApplicationStart() method is only
          executed when the application starts the first time after server
          restart/application timeout. so no matter how many time you overwrite
          your Aplication.cfc file with a new version, the onApplicationStart
          method will not execute until you restart the server or call the method

          instead of restarting cf server, create a .cfm file with this in it:
          <cfdump var="#application#">

          upload the file to your server and call it up in your browser.

          ***delete the file from server after you are done with it!!!***

          Azadi Saryev
          • 2. Application.cfc cached.
            NineCooL Level 1
            ok updates on the situation.. I guess it's not a problem with the Applicaion.CFC I think It's my templates, they are cached with the invalid urls and settings.. now my requirement it to clear that cache without getting into admin panel. is there anyway I can do that..?
            • 3. Re: Application.cfc cached.
              NineCooL Level 1
              ok Azadi, may be I was too exited and didn't see your post b4 I post my comments.. your solution worked out.. nice.. but for some reason your code didn't work as it is.. it was complaining that onApplicationStart(); is undefined, so I did a small tweak to your code..


              <cfdump var="#application#">
              • 4. Re: Application.cfc cached.
                Level 7
                good job!

                yes, i just realized that the code i posted is from onRequestStart() in
                my Application.cfc (sans the <cfdump> part), and that's why it works as
                is without creating an object...

                Azadi Saryev