Use simple cache instead of Guava's?
See original GitHub issueI am packaging my app without springfox, in the production profile, and would now like to get rid of the large guava dependency.
However, it’s being used by PersistentTokenRememberMeServices.java
(for session authentication) and OAuth2AuthenticationService.java
(for gateway/uaa authentication).
But it seems to me that in those places, it is actually a bit heavy-handed to use guava’s Cache class – which is specifically designed to be safe for use by multiple concurrent threads, but here we are bluntly synchronizing on a global lock around it!
https://github.com/jhipster/generator-jhipster/blob/master/generators/server/templates/src/main/java/package/security/_PersistentTokenRememberMeServices.java#L118 https://github.com/jhipster/generator-jhipster/blob/master/generators/server/templates/src/main/java/package/security/oauth2/_OAuth2AuthenticationService.java#L151
Would you consider a PR which replaces this use of guava’s cache by a simple custom implementation? It’s basically just a map with a maintenance thread. I have it mostly done already, and it works like a charm.
But I figured I’d check first, before I spend too much time polishing it and adding unit tests 😃
- Checking this box is mandatory (this is just to show you read everything)
Issue Analytics
- State:
- Created 6 years ago
- Comments:21 (19 by maintainers)
Please let me know if I can be of any help wrt Caffeine.
Awesome!