Menu

Squirix speaks a second language
📰

Squirix speaks a second language

DEV Community: csharp·Alexander Efremov·6 days ago
#Mr8lQwzL
#devtocsharp#devto#dev#squirix#client
Long article (896 words) — no AI summary yet.
Reading 0:00
15s threshold

Squirix 0.2.0 is the first stable release in the 0.2 series. The packages are available on NuGet, and the server now speaks both RESP2 and RESP3. If you already use StackExchange.Redis for caching, you can keep your .NET client and point it at Squirix. Other Redis clients, including redis-cli , can use the same endpoint for the commands listed below.

Cache a product name with StackExchange.Redis

Start a local node with squirix-server run and add the StackExchange.Redis NuGet package to your .NET project. Here’s how to cache a product name for five minutes and read it back:

using StackExchange . Redis ;

using var redis = await ConnectionMultiplexer . ConnectAsync ( "127.0.0.1:6379" ) ; var cache = redis . GetDatabase ( 0 ) ; await cache . StringSetAsync ( "product:42" , "Coffee grinder" , TimeSpan . FromMinutes ( 5 ) ) ; string ? name = await cache . StringGetAsync ( "product:42" ) ; Console .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.