CFML issue on Railo with the accelerate cache tag

We’ve been using Brandon Purcell’s excellent accelerate custom cache tag for a few projects. I had an issue today while testing a new app which is about to go live. It seemed that whatever I did nothing would be cached.

Upon investigation it seemed that the caching worked fine on Adobe ColdFusion but not on Railo. A quick look at the codebase brought me to this line:

<cfif IsDefined("application.accelerator.#scriptName#.#primarykey#.#secondaryKey#")

Basically this was always returning false, even when I knew the key was in the application scope. I changed it to the following:

<cfif structKeyExists(application,"accelerator[scriptName][primarykey][secondaryKey]")

Success! (Thanks AJ for the final structKeyExists)

Just a quick fyi to anyone else who might be using this custom tag on Railo.

Post a Comment or Leave a Trackback

One Comment

  1. May 27, 2010 at 12:07 pm | Permalink

    Hi Michael, one of the variables (#scriptName#, #primarykey#, #secondaryKey#) probably contains one or more periods. Is that right?
    Railo doesn’t check if variable names exist with dots inside when using isDefined(). This is done for speed improvement, as was once discussed on the Railo mailing list.
    But, I did just add this to the bug database at https://jira.jboss.org/browse/RAILO-444.
    Cheers, Paul

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*