I’m working on an API and have implemented caching in several stages to make things as fast as possible. The final caching step within my ColdBox Application Layer would be to serialize the data (in this case as JSON) and cache it within EHCache which I access via ColdBox. I was thinking of adding a flag to the Event.renderData() to denote that the data has already been marshaled so ColdBox could appropriately apply content headers and send the data on its way to the previous visitor.
Before applying this to the core, I wanted to see if there are any thoughts from the ColdBox team or the community.
I’ve thought about allowing my Webserver to cache this content and avoid CF entirely; however, I’ve opted to first validate the parameters and generate a cache-key based only on the valid and actionable paramaters in alphabeticale order to allow me to cache the desired response regardless of how messy the query to the API is.
What do you guys think? Is this something that you could benefit from? I’m trying to shave off every possible millisecond.
Blog post on all this is coming btw.