1

Has anyone used distributed SQL caching in .Net 4.7.2 ? I have seen many sample code for SQL caching with .Net Core but not with .Net Framework 4.7.2. We are currently using Redis cache in the application and I am looking for a Redis replacement. The content size of the data I want to cache is less than 512 MB.

Tried installing Microsoft.Extensions.Caching.Distributed from the nuget package manager but not sure if it will work with .net framework 4.7.2

6
  • nuget.org/packages/Microsoft.Extensions.Caching.SqlServer implements IDistributedCache and works on .NET Framework. Does it work for your needs? However, Redis may be preferable for this scenario - any specific reason to move from Redis to SQL Server? (for context: I help maintain both the Redis and SQL Server libraries for this) Commented Sep 12, 2024 at 21:25
  • Redis is Linux based and the application is deployed on windows OS. There are some security considerations to keep in mind when using Redis on Windows. So we are planning to replace redis and use SQL Caching Commented Sep 13, 2024 at 0:27
  • Oh, for sure you shouldn't use redis-64 (the long-dead Windows fork), but it is easy enough to run redis in a container, or a separate service - or there's things like Garnet (which is a redis-compatible RESP server built on top of the FASTER tech; FASTER is a name here, not a judgement - note that you'd need the v9 version of the Redis IDistributedCache impl to talk to that, which is "preview" for another 2 months, but works on .NET Framework). But back to my question: does the SqlServer package I cited work for you? Commented Sep 13, 2024 at 8:36
  • I should emphasize: my considered professional technical opinion, based on being very very familiar with SQL, Redis, and caching tech (and being an area-owner on behalf of MSFT for those things and these exact libraries), is that Redis usually beats out SQL in this scenario. Commented Sep 13, 2024 at 8:38
  • The SQL Caching worked for me in .Net Framework 4.7.2. Now I am trying to implement SQL caching in my existing project that is using Entity Framework with .Net 4.7.2 Will that work ? Does SQL caching works with Entity Framework Commented Sep 30, 2024 at 22:28

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.