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

Question: does EF core store use caching? #40

Closed
kirill-gerasimenko-da opened this issue May 26, 2023 · 6 comments
Closed

Question: does EF core store use caching? #40

kirill-gerasimenko-da opened this issue May 26, 2023 · 6 comments
Labels

Comments

@kirill-gerasimenko-da
Copy link
Contributor

Hi!

I've started using the project and doing some experiments under the load, and the access time for the current keys to generate the token caught my attention and I've started digging. So I noticed that here

return await _context.SecurityKeys.OrderByDescending(d => d.CreationDate).AsNoTrackingWithIdentityResolution().FirstOrDefaultAsync();
it does call the database, despite the cache hit. Is this something expected? I'd think that it just has to return credentials found in the memory cache at this point. To compare - I've checked with file system store implementation - and it works as I would expect, returning credentials found in the memory cache.

Please advise.

Thanks for the great library!

@kirill-gerasimenko-da kirill-gerasimenko-da changed the title Question: does EF core store uses caching? Question: does EF core store use caching? May 26, 2023
@kirill-gerasimenko-da
Copy link
Contributor Author

I'm willing to put a PR up, if necessary :)

@brunobritodev
Copy link
Member

Definetely, this code doesnt make sense, it should return from cache instead take it again from database.

A PR will be welcome!

@kirill-gerasimenko-da
Copy link
Contributor Author

Great!

I've got weird issue with the change I'm making - the file I'm changing is in UTF-16LE encoding, and it gets recognized as binary by GitHub. I tried to do changes directly in GitHub, but with the same results. I'll try to work around this.

@kirill-gerasimenko-da
Copy link
Contributor Author

Like in here kirill-gerasimenko-da@bd8c167?diff=split#diff-02a402020f707191067d8e3ea8f99d6b1128292d2975d300001beeb37134ae49 - file is shown as binary, but if you open it up - it works and has the changes, weird.

@kirill-gerasimenko-da
Copy link
Contributor Author

#41

github-actions bot pushed a commit that referenced this issue May 29, 2023
## [7.1.2](v7.1.1...v7.1.2) (2023-05-29)

### Bug Fixes

* cache bug ([f26f7d5](f26f7d5)), closes [#40](#40)
* ci ([8baeb3e](8baeb3e))
* dependencies ([6bf5f0a](6bf5f0a))
* dependencies [skip ci] ([45a5c89](45a5c89))
* semantic-release v3 ([2bdd8b7](2bdd8b7))
@github-actions
Copy link

🎉 This issue has been resolved in version 7.1.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

2 participants