dotnet / dotnet/aspnetcore

Add additional strategy to use transactions instead of scripts in StackExchange.Redis implementation

Open
#51,874 0 comments 0 reactions 0 assignees View on GitHub
area-middleware feature-caching
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Is your feature request related to a problem? Please describe the problem.

The current implementation of [StackExchange.Redis](https://github.com/dotnet/aspnetcore/blob/main/src/Caching/StackExchangeRedis/src/RedisCache.cs) relies on LUA scripts.
From a first look it seems to be so in order to execute HSET/HMSET and EXPIRE as an atomic execution.

Althought in some environments EVAL command might be disabled for the users, making the current implementation unusable.

### Describe the solution you'd like

Using transactions could maybe be a good alternative to scripts, in that case the RedisCacheOptions could expose a way to choose the strategy to use, either stick to the default implementation using scripts, or opt-in the use of transactions.

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.