Suggested docs improvement/clarification (query caching) #1258
adamcameron
started this conversation in
General
Replies: 1 comment
-
|
I find the API docs sometimes more useful than the guides. https://api.cfwheels.org/v1.4.5#findall The cfwheels guides are now part of the repo (./guides) if wanted to contribute a PR. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi
I'm reading this: https://guides.cfwheels.org/cfwheels-guides/handling-requests-with-controllers/caching#query-caching, specifically:
The problem is that
cachedWithintakes a timespan, whereas in your example yer passing10.10what?I dug through the code (I am on 1.4.x btw, don't ask), and discovered the answer seems to be "it depends".
Looking at https://github.com/cfwheels/cfwheels/blob/develop/wheels/global/internal.cfm#L212, it looks like there's an application-scoped(!) variable that this
$timeSpanForCachemethod looks for, and it seems that default's ton(https://github.com/cfwheels/cfwheels/blob/develop/wheels/events/onapplicationstart.cfm#L202), so the answer is "10means `10 minutes".So I was wondering if it might be worth updating the docs to explain that the way CFWheels does it actually isn't terribly similar to how CFML does it natively (which would be with a parameter called
cachedWithinthat takes timespan, easy and already known to all CFML devs), but here's how it actually works. Summarising the intent of thisapplication.$wheels.cacheDatePartvariable, and how it relates to the value of thecacheparameter there.Cheers.
Beta Was this translation helpful? Give feedback.
All reactions