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

Enable caching using @EnableCaching #27

Merged
merged 1 commit into from
Aug 25, 2023
Merged

Conversation

pavelfomin
Copy link
Owner

@pavelfomin pavelfomin commented Aug 21, 2023

Adding @Cacheable on the Spring data method may have unintended consequences: https://spring.io/blog/2021/10/18/spring-data-jdbc-how-do-i-implement-caching

@@ -26,8 +26,11 @@ dependencies {
implementation "org.springframework.boot:spring-boot-starter-data-jpa"
implementation "org.springframework.boot:spring-boot-starter-security"
implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server"
// implementation 'org.springframework.boot:spring-boot-starter-cache'
Copy link
Owner Author

Choose a reason for hiding this comment

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

Did not have to add spring-boot-starter-cache for some reason.

@github-actions
Copy link

File Coverage [66.67%]
CacheableService.java 78.57%
Application.java 53.85%
Total Project Coverage 91.83% 🍏

implementation "com.h2database:h2:2.1.210"
// implementation 'com.github.ben-manes.caffeine:caffeine'
Copy link
Owner Author

Choose a reason for hiding this comment

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

Test works w/out this dependency but it's needed to use caffeine and it's cache configuration.

@pavelfomin pavelfomin merged commit 737828a into master Aug 25, 2023
2 checks passed
@pavelfomin pavelfomin deleted the feature/enable-cache branch August 25, 2023 22:51
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.

None yet

1 participant