I was wrestling with view caching today and ran into something of interest I wanted to get a second set of eyes on.
Using the clearView() method on my cache provider (FYI it’s RailoColdBoxProvider) wasn’t clearing my views from the cache. Upon inspection, it’s because there was a colon in the cache key name as set by the renderer but the element cleaner wasn’t adding this same colon to the mix when looking for the key to clear. I just checked the master GitHub branch to see if it’s still there and it is:
Here’s where Renderer generates the cached view key (note the colon that is concatenated in there):
https://github.com/ColdBox/coldbox-platform/blob/master/system/plugins/Renderer.cfc#L151
Here’s where the element cleaner builds the key to attempt to match and clear from the cache (note the absence of the colon):
After adding some debug output into the cleaner, I saw it looking for a key like this:
railo_view-home/loggedInView
But saw that the cached view was in there under this key:
RAILO_VIEW-:HOME/LOGGEDINVIEW
It seems like it’s not able to clear due to the colon not being in the sought-after key generated by ElementCleaner. I’ve added the colon locally and everything works well. Am I missing something? Or if this is a bug, what’s the best way to get this in the right place so it can be solved in a later release?
Thanks,
Adam