Skip to content

Cache implement new#59

Merged
KaltrinaKrasniqi merged 2 commits into
mainfrom
cache_implement_new
May 23, 2025
Merged

Cache implement new#59
KaltrinaKrasniqi merged 2 commits into
mainfrom
cache_implement_new

Conversation

@KaltrinaKrasniqi
Copy link
Copy Markdown
Collaborator

Authorization data such as permissions and roles rarely change but are queried frequently on every request especially for access control. Caching them in Redis will:
-Reduce load on the database
-Speed up authorization checks
-Improve overall response time

Specifically, the following services are now cache-enabled:
-TenantPermissionService
-RolePermissionService
-RoleService
-UserRoleService

In order to use Spring’s https://github.com/Cacheable and @CacheEvict annotations which work on method level, we must override Base methods in the concrete service classes and annotate them appropriately.

INSTRUCTIONS:
Redis is required for the cache to work locally. So all of the group members should:
Install Docker Desktop: Install the first option

Start Redis container:
docker run -d --name redis-server -p 6379:6379 redis
Verify it's running:
docker ps

OTHERWISE will get exceptions on startup or during endpoint calls which uses cache.

Copy link
Copy Markdown
Collaborator

@erzagashi11 erzagashi11 left a comment

Choose a reason for hiding this comment

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

Well done

@KaltrinaKrasniqi KaltrinaKrasniqi merged commit 583191b into main May 23, 2025
2 checks passed
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.

2 participants