Need to inject random value into URL Parameter?

Hi All,
So I've got a public facing coldbox 2.6.x application and I need to
inject a randomly generated url parameter to defeat caching by a
customer's firewall. What I'm hoping is there is an easy way to
across the boards inject something like "&var=RANDOM-VAL-HERE" into my
application since everything runs through "index.cfm?event=foo".
Thanks for any input.

...Brad

You need to create a custom buildLink method using a Request Context Decorator.

Basically,. the Request Context Decorator is an object you create that enhances the Event object. I think this is the old documentation link for your version: http://ortus.svnrepository.com/coldbox/trac.cgi/wiki/cbRequestContextDecoratorGuide

Then, when you call Event.buildLink(‘something’) you can add some random value to the string. All your links rendered to the view using Event.buildLink() would then have your random string to defeat customer firewall caching.

Aaron Greenlee
http://aarongreenlee.com/

Here is some more info to better help you:

  1. Look into the RequestContext CFC for your version of ColdBox.

  2. Copy the Event.BuildLink() function arguments so you dont have to retype them

  3. Create your buildLink function.

  4. Manipulate the incoming args with your random value

  5. Call “return super.buildLink(argumentCollection=arguments)” to let ColdBox do all the hard work.
    Aaron Greenlee

http://aarongreenlee.com/

Thanks for your help Aaron, I'm going to dive into this.

....Brad