docs(web/guides): fix caching guide cache categories, finder-cache store, and invalidation claims - #3066
Conversation
…che store, clearCache scope, config path Audit-verified corrections to digging-deeper/caching.mdx: - caches() time default is a hardcoded 60, not defaultCacheTime - real cache struct categories are action/page/partial/sql/image/main (query is legacy, unwritten) - findAll(cache=N) results live in the engine's cachedWithin query cache, not application.wheels.cache - $clearCache(category="query") is a no-op for finder caches; reload/restart are the real levers - per-environment overrides load from config/development/settings.cfm, not config/environments/ - note current empty-reloadPassword behavior per open issue #3062 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Peter Amiri <peter@alurium.com>
There was a problem hiding this comment.
Wheels Bot — Reviewer
TL;DR: This PR makes five audit-driven corrections to the caching guide (web/sites/guides/src/content/docs/v4-0-0/digging-deeper/caching.mdx), and I verified every one of them against framework source on this branch — all five are accurate. Verdict: comment. No blocking findings; two minor non-blocking nits below (one wording suggestion, one commit-hygiene note).
Correctness (of the doc claims — all verified, no findings)
Each correction was re-checked against the framework source at this PR's head:
caches()hardcoded 60 — confirmed.vendor/wheels/events/init/functions.cfm:25setsapplication.$wheels.functions.caches = {time = 60, static = false}, andcaches()pulls it via$args(args = arguments, name = "caches", ...)(vendor/wheels/controller/caching.cfc:14).defaultCacheTimeis consumed by$timeSpanForCache()forcache=truefinders (vendor/wheels/Global.cfc:810,vendor/wheels/model/read.cfc:339-341) and by the$renderViewAndAddToCache/$renderPartialAndAddToCachefallbacks (vendor/wheels/controller/rendering.cfc:452-455, 477-481) — soset(defaultCacheTime=15)indeed does not touchcaches().- Seven cache categories — confirmed at
vendor/wheels/events/onapplicationstart.cfc:123-131(sql,image,main,action,page,partial,query). Writers verified:read.cfc:288→sql,view/assets.cfc:154→image,controller/processing.cfc:57andcontroller/rendering.cfc:52→action,rendering.cfc:547→partial,$addToCachedefault →main(Global.cfc:837). Nothing writesquery. - Finder results live in the engine query cache — confirmed:
read.cfc:341setscachedWithinon the query execution; only the SQL shell is stored undersql(read.cfc:288). - Reload rotates the cache-key comment — confirmed:
onapplicationstart.cfc:389-390regeneratesapplication.$wheels.cacheKey = Hash(CreateUUID())(clearQueryCacheOnReloaddefaultstrueatevents/init/caching.cfm:29, and on a fullapplicationStop()restart the key never exists, so rotation always happens), anddatabaseAdapters/Base.cfcembedscachekey:#$get("cacheKey")#as a comment in everycachedwithinquery, so rotation invalidates all engine-cached results. - Config path + dev default + reload-password note — confirmed: per-environment overrides load from
/config/#environment#/settings.cfm(onapplicationstart.cfc:326-328; no code path readsconfig/environments/),cacheActions = falseis the framework's development default (events/init/caching.cfm:10), and the empty-reloadPasswordanonymous-reload behavior is real (the template's reload gate atcli/lucli/templates/app/public/Application.cfc:263-272allows the restart when!Len(application.wheels.reloadPassword)), matching open issue #3062.
Docs
- Nit —
pageis as unwritten asquery(caching.mdx:145, the "Where cache entries live" paragraph). The new text singles outqueryas "a legacyquerycategory that nothing writes to," which implies the other six are written. But no framework code writes thepagecategory either — page caching gated oncachePagesstores underaction(vendor/wheels/controller/rendering.cfc:51-52:local.category = "action"inside the$get("cachePages")branch), and a repo-wide grep finds nocategory = "page"writer. Suggest: "…plus legacypageandquerycategories that nothing writes to (page-cached output lands inaction)". Non-blocking — the sentence as written is literally true aboutquery; this just closes the same class of implied-accuracy gap the PR is fixing.
Commits
- Nit — branch commit header is 109 chars.
docs(web/guides): correct caching guide — cache categories, finder-cache store, clearCache scope, config pathexceeds commitlint'sheader-max-lengthof 100 (commitlint.config.js:27). Not blocking: the repo squash-merges and the PR title is the linted gate, and the PR title (docs(web/guides): fix caching guide cache categories, finder-cache store, and invalidation claims) is 97 chars and a valid conventional-commit header. DCO sign-off present and matches the author email.
Tests
Docs-only change; no spec changes required. The edited lines are prose (no {test:compile} blocks were added or modified), and the PR reports pnpm verify:docs passing 10/10 tagged blocks. No changelog fragment is required for a docs-type PR (fragments are for user-facing fix/feat).
Audit-driven corrections to the Caching guide (
digging-deeper/caching.mdx). Four claims in the page were verified wrong against framework source (and live probes on Lucee 7); each fix below cites the source of truth.Corrections
caches()time default is a hardcoded 60, notdefaultCacheTime.The page attributed the 60-minute default to
defaultCacheTime. In factcaches()carries its own literal default —application.$wheels.functions.caches = {time = 60, static = false}(vendor/wheels/events/init/functions.cfm:25).defaultCacheTimegovernscache=truefinders andrenderView()/renderPartial()fallbacks (vendor/wheels/Global.cfc:808-828,vendor/wheels/controller/rendering.cfc:453,479,vendor/wheels/model/read.cfc:339-341), soset(defaultCacheTime=15)would not changecaches(). The bullet now says so.Real cache-struct categories; finder results don't live in
application.wheels.cache.The page listed 5 categories (
action,partial,query,image,main). The struct is actually initialized with 7 —sql,image,main,action,page,partial,query(vendor/wheels/events/onapplicationstart.cfc:123-131) — and nothing in the framework ever writes thequerycategory (writers:read.cfc:288→sql,view/assets.cfc:154→image,controller/processing.cfc:57+rendering.cfc:52→action,rendering.cfc:547→partial). Added the explicit caveat thatfindAll(cache=N)/findByKey(cache=N)results are stored in the CFML engine's native query cache viacachedWithin(vendor/wheels/model/read.cfc:341), with only the SQL shell in thesqlcategory.Invalidation Option 3 rewritten —
$clearCache(category="query")is a no-op for finder caches.Live-verified: stale finder results survived
$clearCache(category="query")because they live in the engine's query cache, not the Wheels struct. The working blunt instruments are?reload=true&password=...— which rotates the cache-key SQL comment embedded in every cached query (vendor/wheels/databaseAdapters/Base.cfc:813-817), invalidating all engine-cached results — or an application restart. The option now says exactly that.Per-environment config path corrected.
config/environments/development.cfmis never read; per-environment overrides load fromconfig/<environment>/settings.cfm(vendor/wheels/events/onapplicationstart.cfc:326-328). Also clarified thatcacheActions=falseis the framework-set development default (vendor/wheels/events/init/caching.cfm:10) — no config file involved.Current reload-password behavior noted (open issue).
Since the page recommends
?reload=true&password=...for cache busting, added a note that an emptyreloadPasswordcurrently allows anonymous?reload=truerestarts, per the open contract-drift issue.Refs #3062
Verification
pnpm verify:docs src/content/docs/v4-0-0/digging-deeper/caching.mdx— 10 tagged blocks, 10 passed, exit 0.developin this branch.🤖 Generated with Claude Code