Wondering if I'm misunderstanding something or if this is a bug. I'm
experiencing a situation where objects annotated with cache="false" in
the CFC and called using getModel() are still being cached.
B. Results
When I look at the cachebox content report, an entry exists for
"wirebox:wirebox-dostuffmodel". As I refresh the page, the "hits"
value for that object increases. In other words, the object is cached
even though it has the cache="false" annotation.
Now, if I remove cache="false" completely from the CFC, then it's not
cached and doesn't even appear in the cache box content report.
In both cases, the object exists in the RC as expected.
A. Setup
1. Start with the advanced application template (no inheritance)
2. Add the binding below you Wirebox.cfc
map("doStuffModel").to("model.doStuffModel");
3. Create a "doStuffModel" CFC in the "model" folder with the
following code
I’d have to check the code, but I know other properties such as “singleton” are not evaluated for their value on their presence. Cache likely falls under the same rules.
Docs say its type is boolean. "Singleton" has no type. Although it's
possible the docs are out of date. If not evaluated, would that make
cache and singleton synonymous?
I ended up removing cache="false" for now so that I can resume
testing. If a bug, it's nasty in that it turned all my transient
objects into singletons.
From what I can tell the cache="false" is still very valid, is it possible
that the object it is inherited in or DI'ed into is either cached or been
created as a singleton?