Function caching (cachedWithin) working without any config but its purging functions are not working

Description

A cluster of related issues to do with the mighty ‘function cachedWithin’ superpowers of Lucee!

(1)

What happens: Lucee’s function caching works even when no function cache is defined in Lucee admin.

What’s expected: if there’s no cache defined, this caching should fail silently; or, the Lucee admin + documentation should be updated so that it’s explained that Lucee falls back to “an internal ram cache (i.e. a good old java struct)” in the absence of a default connection configuration option.

(2)

Lucee admin (server.cfm) reports function cache as having 0 items even though it is provably not empty.

(3)

Lucee admin (server.cfm) function cache clearing button doesn’t work to clear function caches even though the cache is provably not empty.

(4)

Lucee admin (server.cfm) ignores “Develop Mode” when it comes to the function cache; with develop mode enabled, the function cache is still pulled from.

(5)

In code, “SystemCacheClear()” doesn’t work to clear function caches, neither do:

SystemCacheClear(cacheName="all"); SystemCacheClear(cacheName="function");

Environment

Replication:

  • Lucee 5.3.9.166 on Ubuntu

  • Cache Services settings > Default cache connection > Function > ……… (none defined)

  • Function with cachedWithin such as:

<cffunction name="getAnglerMatchesTableObject" output="no" cachedWithin="#CreateTimeSpan(0,0,15,0)#"> <!--- 15 min caching ---> <!--- Strenuous work :] ---> </cffunction>

[Background in community forum]

Attachments

4
  • 02 Nov 2022, 02:45 pm
  • 31 Oct 2022, 11:34 am
  • 31 Oct 2022, 11:34 am
  • 31 Oct 2022, 11:33 am

Activity

Show:

Former user 2 November 2022 at 15:41

Now we’re burning rubber. I can see 14 items in the cache using that snippet. And the second snippet also works to clear the cache! Hooray for this immediate project I’m stuck on!

Pothys - MitrahSoft 2 November 2022 at 15:16
Edited

can you please make try with the cfObjectCache tag to get the size of the cache and clear the object from the cache?

// to get size <cfobjectcache action="size" type="function" result="functionAppCache"/> <cfoutput>#functionAppCache#</cfoutput> // to clear <cfobjectcache action="clear" type="function"/>

Former user 2 November 2022 at 14:49

Yes, , I did, but it didn’t seem to make any difference to ability to purge the cache, even if it’s explicitly setup.

Pothys - MitrahSoft 2 November 2022 at 14:25
Edited

Have you created a function cache through admin?

Once created a function cache in admin, the function cache count is incremented only when the function cache will be used.

Former user 31 October 2022 at 12:05

If Lucee falls back to RAM cache, I think this should be explicitly mentioned and there should be a wording change in the UI.

If there is in fact a “default fallback” when there is no “Default cache connection” specified, I think this should be mentioned in the UI.

I also don't see any reference to this in the documentation, so I think this page and its siblings may need a paragraph adding:

https://docs.lucee.org/guides/deploying-lucee-server-apps/webserver-cache.html

Unresolved

Details

Assignee

Reporter

Priority

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Affects versions

Created 31 October 2022 at 11:38
Updated 21 May 2024 at 23:25

Flag notifications