Skip to content

Add Jedis (for Valkey) caches for domains and hosts#3013

Open
gbrodman wants to merge 1 commit intogoogle:masterfrom
gbrodman:jedis
Open

Add Jedis (for Valkey) caches for domains and hosts#3013
gbrodman wants to merge 1 commit intogoogle:masterfrom
gbrodman:jedis

Conversation

@gbrodman
Copy link
Copy Markdown
Collaborator

@gbrodman gbrodman commented Apr 16, 2026

We add optional Valkey caching of hosts and domains for future use. Eventually, this will allow us to pre-warm large amounts of data in Valkey for quick retrieval during actions like RDAP.

Note: this doesn't actually use the caches yet.

We use Jedis instead of Redisson for speed purposes (https://www.instaclustr.com/blog/redis-java-clients-and-client-side-caching/) which means that we have to implement our own multilayer cache but that's not the worst thing in the world.


This change is Reviewable

@gbrodman gbrodman force-pushed the jedis branch 5 times, most recently from ffce812 to 2198f73 Compare April 17, 2026 14:49
public static DomainCache provideDomainCache(Optional<UnifiedJedis> jedis, Clock clock) {
if (jedis.isEmpty()) {
return domainName ->
ForeignKeyUtils.loadResourceByCache(Domain.class, domainName, clock.nowUtc());
We add optional Valkey caching of hosts and domains for future use. Eventually, this will allow us to pre-warm large amounts of data in Valkey for quick retrieval during actions like RDAP.

Note: this doesn't actually use the caches yet.

We use Jedis instead of Redisson for speed purposes
(https://www.instaclustr.com/blog/redis-java-clients-and-client-side-caching/)
which means that we have to implement our own multilayer cache but
that's not the worst thing in the world.
public static TimeOfYear fromDateTime(DateTime dateTime) {
DateTime nextYear = dateTime.plusYears(1); // This turns February 29 into February 28.
DateTime nextYear =
DateTimeUtils.leapSafeAddYears(dateTime, 1); // This turns February 29 into February 28.
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.

2 participants