GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - sahansera/DistributedCacheAspNetCoreRedis: ⚡️ Distributed caching on .NET with IDistributedCache

BranchesTags
Open more actions menu

Latest commit

 

History

17 Commits
17 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
DistributedCache.Tests
DistributedCache.Tests
 
 
DistributedCache
DistributedCache
 
 
.gitignore
.gitignore
 
 
DistributedCachingNetCoreTutorial.sln
DistributedCachingNetCoreTutorial.sln
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
docker-compose.yaml
docker-compose.yaml
 
 
global.json
global.json
 
 

Repository files navigation

Distributed Caching on .NET with IDistributedCache

.NET CodeQL Twitter: _SahanSera

Intro 👋

This project uses ASP.NET Core's IDistributedCache abstraction with Redis to share cached data between application instances. If you only need a cache inside one application process, my in-memory caching project is a better starting point.

I've also blogged this with a full explanation of how this is achieved.

main targets .NET 10 LTS. The unsupported .NET 5 version remains available on the dotnet5 branch for historical reference.

Architecture 🏗

  1. User requests a user object.
  2. App server checks if we already have a user in the cache and return the object if present.
  3. App server makes a HTTP call to retrieve the list of users.
  4. Users service returns the users list to the app server.
  5. App server sends the users list to the distributed (Redis) cache.
  6. App server gets the cached version until it expires (TTL).
  7. User gets the cached user object.

Usage 🚀

Requirements:

  • .NET 10 SDK
  • Docker with Docker Compose

Start Redis:

docker compose up -d

Run the application:

dotnet run --project DistributedCache/DistributedCache.csproj

Build and test the solution:

dotnet test

Questions? Bugs? Suggestions for Improvement? ❓

Having any issues or troubles getting started? Get in touch with me

Support 🎗

Has this Project helped you learn something new? or helped you at work? Please consider giving a ⭐️ if this project helped you!

Share it! ❤️

Please share this Repository within your developer community, if you think that this would make a difference! Cheers.

Contributing ✍️

PRs are welcome! Thank you

About

⚡️ Distributed caching on .NET with IDistributedCache

sahansera.dev/distributed-caching-aspnet-core-redis/

Topics

asp-net-corecachingdistributed-cachedockerdotnetdotnet-coreredis

Resources

Readme
MIT license
Activity

Stars

26 stars

Watchers

2 watching

Forks

6 forks
Report repository

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.