@kpetrow Hi and welcome to Lucee. The change I believe you are talking about was made to dramatically improve performance in Lucee. Railo (and early versions of Lucee) used to duplicate the cache every time so local changes wouldn’t be persisted in the cached version but this caused a considerable amount of overhead for large queries. I put in the ticket to change the behavior because I had a client whose entire site would go down due to the fact that cloning a query was single threaded!!
This led to absolutely horrible performance on my client’s app since every single web request cloned the same query and it basically single threaded their entire web app.
Micha changed queries to not be duplicated so if a user wanted to modify the query, it was up to them to duplicate it on their own. I think he also tried to put in some logic that would detect if you changed a query and would then duplicated it on the fly for you, but I’m not sure I ever tested that.
I’m not completely sure what your example is doing above but it seems you’re trying to obtain a query that may be cached and modify it on the fly before returning it? If that is the case, your changes inside the if statement would never be reflected inside the cached version of the query. But, based on how Railo/Lucee used to work, I think that would have always been the case since it always used to duplicate int he past so I’m not entire sure what you’re saying changed from your perspective.