In the hopes that this will save someone else embarassing admissions
and heartachec, I'll go ahead and share a Silly Mistake, and a working
fix:

Way back when we'd first started using Mach-II, I was doing a lot of
little sample apps, which seemed to run a bit slow, but I figured that
was just my laptop; when we got the new server for our latest project,
I loaded it up with the first few project files, and loaded the app.

Still kinda slow . . . scarily so, in fact . . . and as I kept
testing, it didn't get any better.  Full production mode, but even
just a few users bogged it down something fierce.

So I started pushing for performance enhancements where I normally
wouldn't have -- cached queries, eliminating possible bottlenecks . .
. all the stuff we're warned to avoid until we *know* there's a
problem -- hey, I *knew* there was a problem!

As more and more of the app went live, I got more and more nervous . .
. every time I tried a full production mode (reload set to Never), the
app barely sped up from its normal development mode speed.

And then one day I re-read the comments in the index file for
MACHII_RELOAD_MODE . . . and realized I'd been setting it to "1"
(always) instead of "-1" (never)!  I changed it to "-1", and the first
refresh took just as long as ever . . . but the second one was so fast
that I didn't even see it happen!  *What* a relief!

When I finished kicking myself, and removing the performance
enhancements, I changed the index.cfm to create variables for those
values:

        MACHII_RELOAD_NEVER =           -1;
        MACHII_RELOAD_DYNAMIC =         0;
        MACHII_RELOAD_ALWAYS =          1;

In development mode, as others have done, we let developers pass a
reload param in the URL to set the reload mode to Always:

        if (structKeyExists(url, "reload") ) {
                MACHII_CONFIG_MODE =    MACHII_RELOAD_ALWAYS;
        } else {
                MACHII_CONFIG_MODE =    MACHII_RELOAD_DYNAMIC; 
        }

In production, we use this:

        MACHII_CONFIG_MODE = MACHII_RELOAD_NEVER;

It was a very enlightening lesson . . . but I hope reading about this
method of avoiding it will be just as enlightening!  :*)

=tracy

On Wed, 16 Mar 2005 15:35:08 -0500, Peter J. Farrell
<[EMAIL PROTECTED]> wrote:
> solomon folks wrote:
> 
> >Hello,
> >
> >
> >I'm looking for the best way to force Mach-II to
> >recompile a particular page when the index.cfm
> >indicates "MACHII_CONFIG_MODE = -1".
> >
> >I tried to add a dummy parameter in the URL to force a
> >recompile (&abcd=1234) that didn't work. Stop/Restart
> >of the CF services is not an option...
> >
> >I know fusebox has a parameter you can indicate in the
> >URL to force that... did someone come up with a nice
> >way to do this with Mach-II as well ??
> >
> >
> >
> Solomon -
> 
> The MachII_Config_Mode cause the entire mach-ii app to reload - you'll
> use any instance data stored in CFCs.  I don't know exactly what you
> mean by "recompile a particular page" - I assum you mean reload the
> entire application.
> 
> This is what I use in my index.cfm:
> <SNIP>
> 
> <cfif structKeyExists(URL,"reloadApp") AND url.reloadApp EQ 1 >
>     <cfset MACHII_CONFIG_MODE = 1 />
> <cfelse>
>     <!--- Set the configuration mode (when to reload): -1=never,
> 0=dynamic, 1=always --->
>     <cfset MACHII_CONFIG_MODE = 0 />
> </cfif>
> 
> </SNIP>
> 
>  HTH,
> .pjf
> 
> You might be interested in joining the Mach-II list at topica:
> http://lists.topica.com/lists/mach-ii-coldfusion/
> As it might be a better resource for Mach-II specific questions...
> 
> --
> Peter J. Farrell :: Maestro Publishing
> 
> blog    :: http://blog.maestropublishing.com
> email   :: [EMAIL PROTECTED]
> phone   :: 651-204-0513
> 
> Old Computer programmers never die, they just decompile.
> --
> 
> 
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email to 
> [email protected] with the words 'unsubscribe cfcdev' as the subject of the 
> email.
> 
> CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
> (www.cfxhosting.com).
> 
> An archive of the CFCDev list is available at
> www.mail-archive.com/[email protected]
> 
>

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]

Reply via email to