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.
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.
Here is some more info to better help you:
Look into the RequestContext CFC for your version of ColdBox.
Copy the Event.BuildLink() function arguments so you dont have to retype them
Create your buildLink function.
Manipulate the incoming args with your random value
Call “return super.buildLink(argumentCollection=arguments)” to let ColdBox do all the hard work.
Thanks for your help Aaron, I'm going to dive into this.