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

Quarkus Redis Cache: expire-after-access config property #33615

Closed
AndreasPetersen opened this issue May 25, 2023 · 5 comments · Fixed by #34527
Closed

Quarkus Redis Cache: expire-after-access config property #33615

AndreasPetersen opened this issue May 25, 2023 · 5 comments · Fixed by #34527
Assignees
Labels
Milestone

Comments

@AndreasPetersen
Copy link

Description

The Quarkus Cache with Caffeine as backend has the following property:

quarkus.cache.caffeine.expire-after-access

The Redis Cache backend, however, only has the following property:

quarkus.cache.redis.ttl

corrosponding to the Caffeine backend property:

quarkus.cache.caffeine.expire-after-write

Implementation ideas

A new property for the Redis backend similar to the one for the Caffeine backend:

quarkus.cache.caffeine.expire-after-access

@quarkus-bot
Copy link

quarkus-bot bot commented May 25, 2023

/cc @cescoffier (redis), @gsmet (redis), @gwenneg (cache), @machi1990 (redis)

@cescoffier
Copy link
Member

This can be implemented using the GETEX command.

@AndreasPetersen
Copy link
Author

Thanks for the suggestion @cescoffier . The Quarkus Redis Cache guide does not seem to mention commands. The Redis Reference does however. Do I understand it correctly that we can use the Quarkus Cache with Redis as backend, in combination with the commands as described in the Redis reference?

@cescoffier
Copy link
Member

That was more a note about how we could implement the feature (the backend implementation use the redis client underneath).

You can of course combine both, you just need to compute the keys.

@cescoffier cescoffier self-assigned this Jul 3, 2023
cescoffier added a commit to cescoffier/quarkus that referenced this issue Jul 4, 2023
Also rename the ttl property to expire-after-write to align the configuration with the Caffeine cache.

Fix quarkusio#33615
@quarkus-bot quarkus-bot bot added this to the 3.3 - main milestone Jul 5, 2023
@AndreasPetersen
Copy link
Author

Amazing, thanks!

danielsoro pushed a commit to danielsoro/quarkus that referenced this issue Jul 31, 2023
Also rename the ttl property to expire-after-write to align the configuration with the Caffeine cache.

Fix quarkusio#33615
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants