• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Application.cfc cached.

Guest
Nov 16, 2008 Nov 16, 2008

Copy link to clipboard

Copied

hi,
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.
TOPICS
Advanced techniques

Views

545

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Deleted User
Nov 17, 2008 Nov 17, 2008
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..

quote:

<cfscript>
App=createObject('component','Application');
App.onApplicationStart();
</cfscript>
<cfdump var="#application#">

Votes

Translate

Translate
LEGEND ,
Nov 16, 2008 Nov 16, 2008

Copy link to clipboard

Copied

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
programmatically:

instead of restarting cf server, create a .cfm file with this in it:
<cfscript>onApplicationStart();</cfscript>
<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
Sabai-dee.com
http://www.sabai-dee.com/

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 16, 2008 Nov 16, 2008

Copy link to clipboard

Copied

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..?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 17, 2008 Nov 17, 2008

Copy link to clipboard

Copied

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..

quote:

<cfscript>
App=createObject('component','Application');
App.onApplicationStart();
</cfscript>
<cfdump var="#application#">

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 17, 2008 Nov 17, 2008

Copy link to clipboard

Copied

LATEST
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
Sabai-dee.com
http://www.sabai-dee.com/

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation