Continuing the discussion from In which scope would you store a cachedWithin query within a function?:
I’d said earlier in the thread, replying to Jason/philllyun that:
Here’s that follow-up comment:
While we’re on that topic (of what a dump of the results of a query shows, if cachedwithin or cachedafter are used), I’ll share that I have long felt that Adobe (and Lucee, following their implementation) made an unfortunate choice in the name of result struct key being the words “cached”.
Sure, as long-time CFML devs would know, we accept that telling us “did the result come from cache?” (because it’s false when we first run something that’s “to be cached” and true when it came from cache).
But of course the English syntax implied by that keyname “cached” would be read more naturally (and by many folks) to indicate “was the query cached after running the query?”. But that’s NOT in fact what it tells us (because, again, the first call would say “false”). Again, repeating the same query within the cached time would return “true”, which is telling us it “came from cache”.
So in fact, last year I created a tracker ticket with Adobe proposing that this should be split into two new keys, wasCached and fromCache–because there really are cases where use of cachedwithin (or cachedafter) may return true or false for either.
I give an example and more discussion in the bug report. But I noticed just today that I made a pretty grave mistake in my first two paragraphs after the code example there, referring in my words to a q2 and q3 when instead the code has only queries named cq1 and cq2. Doh! I’m sure that confused some when they may have seen the bug report. It was just a mistake in translating a more elaborated working set of examples into that simple pair I showed there.
So if any of you may go there now, please keep that in mind. And that’s why I’ve held off offering that tracker URL until now.
And before posting this, I figured how to split this off as a new topic, leaving a breadcrumb in the original thread. This new discussion seems within the realm of the other thread, but I didn’t want to clutter that other thread with this.