Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@tresoldigiorgio
Copy link
Contributor

…ation cache key in cache

@omarpiani
Copy link
Member

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.

@jtreuting
Copy link
Member

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();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.