Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 30670 per object ttl cache #30692

Merged
merged 2 commits into from
Nov 22, 2024
Merged

Issue 30670 per object ttl cache #30692

merged 2 commits into from
Nov 22, 2024

Conversation

wezell
Copy link
Contributor

@wezell wezell commented Nov 18, 2024

This pull request includes significant changes to the CacheProviderAPIImpl class and introduces new classes to handle dynamic TTL caching. The most important changes include refactoring the CacheProviderAPIImpl class to simplify its methods, adding support for per-object TTL in caching, and implementing new cache classes.

Refactoring and Simplification:

  • CacheProviderAPIImpl.java: Refactored the class to simplify the initialization and management of cache providers, including the removal of unused fields and methods, and the use of Optional and Try for error handling. [1] [2] [3] [4] [5] [6]

Dynamic TTL Caching:

  • CacheValue.java: Introduced a new class to represent cache values with an optional TTL.
  • DynamicTTLCache.java: Implemented a new cache class that supports dynamic TTL for each cache entry using the Caffeine library.

Cache Provider Updates:

  • CacheProvider.java: Added a new method to support per-object TTL in cache providers, with a default implementation that logs a warning if not supported.

These changes aim to improve the flexibility and maintainability of the caching system, allowing for more granular control over cache expiration and simplifying the overall code structure.

This PR fixes: #30670

Copy link
Contributor

@jdotcms jdotcms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice change

@wezell wezell changed the title Issue 30670 per obect ttl cache Issue 30670 per object ttl cache Nov 19, 2024
@wezell wezell linked an issue Nov 21, 2024 that may be closed by this pull request
… to our CaffineCache and really deprecates the timed cache provider.

ref:#30670
@wezell wezell force-pushed the issue-30670-per-obect-ttl-cache branch from 4b1024a to f157851 Compare November 21, 2024 15:05
… to our CaffineCache and really deprecates the timed cache provider.

ref:#30670
@wezell wezell enabled auto-merge November 21, 2024 19:14
@wezell wezell added this pull request to the merge queue Nov 22, 2024
Merged via the queue into main with commit 5384726 Nov 22, 2024
37 checks passed
@wezell wezell deleted the issue-30670-per-obect-ttl-cache branch November 22, 2024 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow TimedCacheProvider to take per object TTLs
3 participants