Hello, I'm using version 1.5 and trying to find a way to reload the cached components in the various environments (ex. production) without having to log into the application. I have considered upgrading and using the dashboard, but there are security concerns about having the dashboard in production, as it might be accessible from the outside and the password option is hardcoded into the config file. Also, there is a web cluster in place, meaning each time a release is made, someone would have to go in and manually reload the components on each node in the cluster. Is there any other way to manually reload the components without the user needing to log in, and perhaps a way to schedule it nightly?
On Wednesday, March 21, 2012 1:20:18 PM UTC-4, RobM wrote:
> Hello, I'm using version 1.5 and trying to find a way to reload the cached > components in the various environments (ex. production) without having to > log into the application. I have considered upgrading and using the > dashboard, but there are security concerns about having the dashboard in > production, as it might be accessible from the outside and the password > option is hardcoded into the config file. Also, there is a web cluster in > place, meaning each time a release is made, someone would have to go in and > manually reload the components on each node in the cluster. Is there any > other way to manually reload the components without the user needing to log > in, and perhaps a way to schedule it nightly?
In the past (and present, actually) I've set up a flag in OnRequestStart() that looks for a url param that no one would ever ever try passing in.....
<cfif param exists (and its value is good, etc)> <cfset structClear(application) /> <cfset onApplicationStart() /> </cfif>
It's extremely dirty, and probably exerts a non-zero load on the server for having to be checked on every request, but it's eminently usable and can easily be scheduled (just point your scheduled task at a url and attach ?superSpecialParamBomb=momerath to it)...
On Mon, Mar 26, 2012 at 6:34 AM, RobM <anime1...@gmail.com> wrote: > Was it something I said? Or is that not possible?
> On Wednesday, March 21, 2012 1:20:18 PM UTC-4, RobM wrote:
>> Hello, I'm using version 1.5 and trying to find a way to reload the >> cached components in the various environments (ex. production) without >> having to log into the application. I have considered upgrading and using >> the dashboard, but there are security concerns about having the dashboard >> in production, as it might be accessible from the outside and the password >> option is hardcoded into the config file. Also, there is a web cluster in >> place, meaning each time a release is made, someone would have to go in and >> manually reload the components on each node in the cluster. Is there any >> other way to manually reload the components without the user needing to log >> in, and perhaps a way to schedule it nightly?
Just to clarify -- this is a nuclear option, and it obviously kills everything that's stored in your application scope. I believe there is a method somewhere in the framework for clearing only its object cache...but the same approach could be used.
On Mon, Mar 26, 2012 at 9:02 AM, Joe Bodell <joe.bod...@gmail.com> wrote: > In the past (and present, actually) I've set up a flag in OnRequestStart() > that looks for a url param that no one would ever ever try passing in.....
> <cfif param exists (and its value is good, etc)> > <cfset structClear(application) /> > <cfset onApplicationStart() /> > </cfif>
> It's extremely dirty, and probably exerts a non-zero load on the server > for having to be checked on every request, but it's eminently usable and > can easily be scheduled (just point your scheduled task at a url and attach > ?superSpecialParamBomb=momerath to it)...
> --Joe
> On Mon, Mar 26, 2012 at 6:34 AM, RobM <anime1...@gmail.com> wrote:
>> Was it something I said? Or is that not possible?
>> On Wednesday, March 21, 2012 1:20:18 PM UTC-4, RobM wrote:
>>> Hello, I'm using version 1.5 and trying to find a way to reload the >>> cached components in the various environments (ex. production) without >>> having to log into the application. I have considered upgrading and using >>> the dashboard, but there are security concerns about having the dashboard >>> in production, as it might be accessible from the outside and the password >>> option is hardcoded into the config file. Also, there is a web cluster in >>> place, meaning each time a release is made, someone would have to go in and >>> manually reload the components on each node in the cluster. Is there any >>> other way to manually reload the components without the user needing to log >>> in, and perhaps a way to schedule it nightly?
Does it have to be OnRequestStart() or does doing it later cause the request to not complete? If not, it could be made into an event call with some validation instead of an arbitrary url param.
On Monday, March 26, 2012 10:02:04 AM UTC-4, Joe Bodell wrote:
> In the past (and present, actually) I've set up a flag in OnRequestStart() > that looks for a url param that no one would ever ever try passing in.....
> <cfif param exists (and its value is good, etc)>
> <cfset structClear(application) />
> <cfset onApplicationStart() />
> </cfif>
> It's extremely dirty, and probably exerts a non-zero load on the server > for having to be checked on every request, but it's eminently usable and > can easily be scheduled (just point your scheduled task at a url and attach > ?superSpecialParamBomb=momerath to it)...
> --Joe
> On Mon, Mar 26, 2012 at 6:34 AM, RobM <anime1...@gmail.com> wrote:
>> Was it something I said? Or is that not possible?
>> On Wednesday, March 21, 2012 1:20:18 PM UTC-4, RobM wrote:
>>> Hello, I'm using version 1.5 and trying to find a way to reload the >>> cached components in the various environments (ex. production) without >>> having to log into the application. I have considered upgrading and using >>> the dashboard, but there are security concerns about having the dashboard >>> in production, as it might be accessible from the outside and the password >>> option is hardcoded into the config file. Also, there is a web cluster in >>> place, meaning each time a release is made, someone would have to go in and >>> manually reload the components on each node in the cluster. Is there any >>> other way to manually reload the components without the user needing to log >>> in, and perhaps a way to schedule it nightly?
You could do it in onRequestEnd() or somewhere else in the request sequence, or in an actual event call so it's not being checked on each and every request, sure :) The main reason I do it this way right now is that we have Mach-ii running within a larger legacy app, and we want to be able to reload ORM/coldspring services from anywhere. So we could probably create a procedural template to do the same thing....but hey, nuclear = good. Or something.
But yes, more than one way to skin this particular cat. The key is knocking out the current contents of the application scope and hitting onApplicationStart(), which should reload the framework and cached components, etc.
On Mon, Mar 26, 2012 at 9:18 AM, RobM <anime1...@gmail.com> wrote: > Does it have to be OnRequestStart() or does doing it later cause the > request to not complete? If not, it could be made into an event call with > some validation instead of an arbitrary url param.
> On Monday, March 26, 2012 10:02:04 AM UTC-4, Joe Bodell wrote:
>> In the past (and present, actually) I've set up a flag in >> OnRequestStart() that looks for a url param that no one would ever ever try >> passing in.....
>> <cfif param exists (and its value is good, etc)> >> <cfset structClear(application) /> >> <cfset onApplicationStart() /> >> </cfif>
>> It's extremely dirty, and probably exerts a non-zero load on the server >> for having to be checked on every request, but it's eminently usable and >> can easily be scheduled (just point your scheduled task at a url and attach >> ?superSpecialParamBomb=momerath to it)...
>> --Joe
>> On Mon, Mar 26, 2012 at 6:34 AM, RobM <anime1...@gmail.com> wrote:
>>> Was it something I said? Or is that not possible?
>>> On Wednesday, March 21, 2012 1:20:18 PM UTC-4, RobM wrote:
>>>> Hello, I'm using version 1.5 and trying to find a way to reload the >>>> cached components in the various environments (ex. production) without >>>> having to log into the application. I have considered upgrading and using >>>> the dashboard, but there are security concerns about having the dashboard >>>> in production, as it might be accessible from the outside and the password >>>> option is hardcoded into the config file. Also, there is a web cluster in >>>> place, meaning each time a release is made, someone would have to go in and >>>> manually reload the components on each node in the cluster. Is there any >>>> other way to manually reload the components without the user needing to log >>>> in, and perhaps a way to schedule it nightly?
On Monday, March 26, 2012 7:34:26 AM UTC-4, RobM wrote:
> Was it something I said? Or is that not possible?
> On Wednesday, March 21, 2012 1:20:18 PM UTC-4, RobM wrote:
>> Hello, I'm using version 1.5 and trying to find a way to reload the >> cached components in the various environments (ex. production) without >> having to log into the application. I have considered upgrading and using >> the dashboard, but there are security concerns about having the dashboard >> in production, as it might be accessible from the outside and the password >> option is hardcoded into the config file. Also, there is a web cluster in >> place, meaning each time a release is made, someone would have to go in and >> manually reload the components on each node in the cluster. Is there any >> other way to manually reload the components without the user needing to log >> in, and perhaps a way to schedule it nightly?
I usually use config mode = 0 or a special url var that set the config mode to 1 for that request. I have my ant deployment script hit the app with the special url var to trigger the reload once deploy is done.
On Mon, Mar 26, 2012 at 9:24 AM, RobM <anime1...@gmail.com> wrote: > Am I right in guessing that most people let it load with the application > scope when config_mode = 0?
> On Monday, March 26, 2012 7:34:26 AM UTC-4, RobM wrote:
>> Was it something I said? Or is that not possible?
>> On Wednesday, March 21, 2012 1:20:18 PM UTC-4, RobM wrote:
>>> Hello, I'm using version 1.5 and trying to find a way to reload the >>> cached components in the various environments (ex. production) without >>> having to log into the application. I have considered upgrading and using >>> the dashboard, but there are security concerns about having the dashboard in >>> production, as it might be accessible from the outside and the password >>> option is hardcoded into the config file. Also, there is a web cluster in >>> place, meaning each time a release is made, someone would have to go in and >>> manually reload the components on each node in the cluster. Is there any >>> other way to manually reload the components without the user needing to log >>> in, and perhaps a way to schedule it nightly?