You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently RedisIndexedSessionRepository and its' reactive equivalent save a shadow key for each session. Redis 7.4 supports hash field expiration, which can benefit this class. The shadow key can be fully replaced with a single new hash field attached to each session.
This brings multiple benefits:
lower traffic, less commands sent to Redis
there is one key fewer per session, and the id change no longer has a window where the hash is renamed but the shadow key is not
in cluster node the shadow key and hash currently land in different slots; with one key this cannot happen
non-expiring sessions become a simple HPERSIST command for the new expiration marker field
This can be achieved by creating an interface that has 2 implementations - the hash field variant and the shadow key variant. The repository class can default to the shadow key approach to ensure backwards compatibility and users could opt in for the new approach by turning it on through a setter method.
Would you be interested in me contributing this improvement?
Activity