First time generation number is requested return 1 without save gener…#221
First time generation number is requested return 1 without save gener…#221tresoldigiorgio wants to merge 2 commits intoSharpRepository:developfrom
Conversation
…ation cache key in cache
|
As known we need to unit test. @jtreuting , what is this Generational parameter in caching? is there some documentation somewhere? seems a nonsense that is not updated in many cases. |
|
Here is some more info about the generational caching: http://fairwaytech.com/2012/09/write-through-and-generational-caching/ Essentially, there is a shared generation number that is used as part of the cache key. Instead of needing to keep track of what is cached in order to flush only those specific things when needed, when there is an update to the DB the generation number gets incremented and therefore expires the old cached data that used the previous number. |
| if (!CachingProvider.Get(GetGenerationKey(), out int generation)) | ||
| { | ||
| IncrementGeneration(); | ||
| return GetGeneration(); |
There was a problem hiding this comment.
couldn't this be simplified to return IncrementGeneration(); since it returns what that key is there shouldn't be a need to ask for it again.
…ation cache key in cache