https://github.com/dotnet-labs/immutable-collection-inmemory-cache
Working with Cache using Immutable Collections
https://github.com/dotnet-labs/immutable-collection-inmemory-cache
asp-net-core aspnetcore cache dotnet dotnetcore immutable immutable-collections memory-cache
Last synced: 19 days ago
JSON representation
Working with Cache using Immutable Collections
- Host: GitHub
- URL: https://github.com/dotnet-labs/immutable-collection-inmemory-cache
- Owner: dotnet-labs
- License: mit
- Created: 2019-03-31T02:42:32.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-07-09T20:15:17.000Z (almost 6 years ago)
- Last Synced: 2025-05-21T12:51:30.619Z (12 months ago)
- Topics: asp-net-core, aspnetcore, cache, dotnet, dotnetcore, immutable, immutable-collections, memory-cache
- Language: C#
- Homepage: https://codeburst.io/a-use-case-of-immutable-collections-dd558f614722
- Size: 10.7 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# A Use Case of Immutable Collections
## [Medium Article: A Use Case of Immutable Collections](https://codeburst.io/a-use-case-of-immutable-collections-dd558f614722)
Caching can greatly improve an application’s performance by reducing the trips to fetch data that changes infrequently. The consistency of cached values is critical at run-time. At development time, we can avoid some human errors by setting caches to be **Immutable** Collections, so that cached values are not able to be mutated accidentally in code.
This blog post will use the simplest cache `IMemoryCache` in .NET Core to demonstrate usages of Immutable Collections, which is also native in .NET framework. The sample code is in this GitHub repository.