dotCMS / core

Headless/Hybrid Content Management System for Enterprises
http://dotcms.com
Other
865 stars 467 forks source link

Allow TimedCacheProvider to take per object TTLs #30670

Open wezell opened 1 week ago

wezell commented 1 week ago

Parent Issue

No response

User Story

We have a timed cache provider that allows us to set a group TTL. When we want to build a cache that uses a per object TTL, we have to write some nasty code to work around this fact - and do things like have wrapper object and cleanup threads to remove stale entries. This is important for things like the blockdirectivecache and the Page cache, where each object has a specific TTL.

Acceptance Criteria

Allow networked caches to have a specific TTL per object.

Steps to Reproduce

github-actions[bot] commented 1 week ago

PRs:

jcastro-dotcms commented 3 days ago

INTERNAL QA: PASSED ✅

The CaffineCache is now using the DynamicTTLCache for providing per object TTL entries now, as expected. This is what the Settings > Maintenance > CACHE > Cache Stats looked like before the change -- notice the Timed Cache Provider Section there:

before

And this is what it looks like now:

after
josemejias11 commented 22 hours ago

Approved: Tested on trunk_68612b9, Docker, macOS 14.5, FF v126.0.1