Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IsExpired not working after extending absolute expiration #136

Closed
MichaCo opened this issue Mar 15, 2017 · 0 comments
Closed

IsExpired not working after extending absolute expiration #136

MichaCo opened this issue Mar 15, 2017 · 0 comments
Assignees
Labels
Milestone

Comments

@MichaCo
Copy link
Owner

MichaCo commented Mar 15, 2017

There seems to be a bug in the logic as IsExpired compared absolute expiration against the created date. But when extending the absolute expiration, the timespan gets calculated with the current UtcNow.

When doing that a few times, IsExpired will start to return true although the item is not expired.

Workaround for now is to create a new CacheItem everytime you manally extend absolut expiration (if you need to manually control/build your own sliding expiration).

Solution would be to actually rewrite/modify the created date the moment absolute expiration gets modified. Or, safe another date field instead which might be even more data to store in Redis etc...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant