Skip to content

Commit e1808ed

Browse files
committed
Package for nuget and add readme
1 parent 6956777 commit e1808ed

File tree

3 files changed

+63
-4
lines changed

3 files changed

+63
-4
lines changed

.gitignore

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1-
# Text editors
2-
.vs/
3-
.vscode/
1+
# Text editors
2+
3+
.vs/
4+
5+
.vscode/
6+
7+
8+
9+
obj/
410

5-
obj/
611
bin/
12+
13+
# Secret
14+
PublishToNuget.bat

README.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# DotNet Core Memory Cache Service
2+
3+
## Purpose
4+
5+
The DotNet Core [Microsoft.Extensions.Caching.Memory](https://github.com/aspnet/Caching/tree/dev/src/Microsoft.Extensions.Caching.Memory) lacks the ability to easily remove groups of items from the cache. This is a [know limitation](https://github.com/aspnet/Caching/issues/187) which apparently there is no interest in addressing.
6+
7+
## Compatability
8+
9+
* NET Standard + Platform Extensions,Version=v2.0
10+
* NET Core + Platform Extensions,Version=v2.0
11+
12+
## Features
13+
14+
* When adding items to the cache, specify the group they belong to
15+
* Remove a group of cached items by group name
16+
* Remove all items in the cache
17+
* Specify the item's cache lifetime in seconds when adding an item to the cache
18+
* Synchronous and Asynchonous factory lamda functions
19+
20+
## Future
21+
Please feel free to make a pull request. :)
22+
* Implement other methods from IMemoryCache
23+
* Unit tests
24+
* Query the cache status
25+
26+
## Example
27+
Run the included example dotnet console application which demonstrates a simulated database of products where accessing the database is an expensive operation, so these query results are meant to be cached in a product provider.
28+
29+
When a change is made to the product database, the cache has items removed from that product's categories, so when future requests for product lists will pick up the new product immediately.
30+
31+
The console output shows that the first time the beer list is queries, an expensive database operation happens, and subsequent request are served from the cache.
32+
33+
Once a new item is added to the category, the cache for that category becomes invalidated, and the next reqeust for the beer list correctly results in another expensive database hit.
34+
35+
## Getting Started
36+
37+
If deploying to a server farm and you want to stick with in-memory cache, be sure to configure the load balancer to use sticky sessions.

source/DotNetCoreMemoryCacheService.csproj

+14
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@
33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
55
<RootNamespace>GeekyMonkey.DotNetCore</RootNamespace>
6+
<PackageTags>MemoryCache</PackageTags>
7+
<Authors>Russ Painter</Authors>
8+
<Company>Geeky Monkey Ltd.</Company>
9+
<PackageId>GeekyMonkey.DotNetCoreMemoryCacheService</PackageId>
10+
<Product>DotNet Core Memory Cache Service</Product>
11+
<Description>An extension to the MemoryCache included in DotNet Core that allows for removing groups of items (or all items) from the cache.</Description>
12+
<Copyright>2018 Geeky Monkey Ltd. (MIT License)</Copyright>
13+
<RepositoryUrl>https://github.com/GeekyMonkey/DotNetCoreMemoryCacheService.git</RepositoryUrl>
14+
<RepositoryType>Git</RepositoryType>
15+
<PackageProjectUrl>https://github.com/GeekyMonkey/DotNetCoreMemoryCacheService</PackageProjectUrl>
16+
<PackageLicenseUrl>https://raw.githubusercontent.com/GeekyMonkey/DotNetCoreMemoryCacheService/master/LICENSE</PackageLicenseUrl>
17+
<PackageReleaseNotes>Initial release is not at all "complete". But it does everything that I need it to do for my project. Feel free to make a pull request if you need additional functionality. Should be easy to add to.</PackageReleaseNotes>
18+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
19+
<PackageIconUrl>http://geekymonkey.com/favicon.ico</PackageIconUrl>
620
</PropertyGroup>
721

822
<ItemGroup>

0 commit comments

Comments
 (0)