Skip to content

added group caching feature #125

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

Merged

Conversation

bountyC0d3r
Copy link
Collaborator

No description provided.

Copy link
Contributor

@ThomasKranitsas ThomasKranitsas left a comment

Choose a reason for hiding this comment

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

When caching a group from getGroup we take into consideration the includeSubGroups/includeParentGroups filters. But, the next time we query for the same group ID, we return whatever is in the cache without checking those.

Example scenario:

  • Request for group A without parent or sub groups
  • The group is fetched from DB and cached
  • Request for the same groups again from cache and also request sub groups
  • The group is returned without sub groups as it's cached without sub groups

@ThomasKranitsas
Copy link
Contributor

@bountyC0d3r here's the ideal implementation IMHO:

Check cache, if data is in there, check if `sub` and/or `parent` groups are required, if required and not in cache, fetch from DB and update cache. Return data.

This way, we don't fetch unnecessary data for caching but we don't worry about data not being in cache as we're checking before we return it

@bountyC0d3r
Copy link
Collaborator Author

@ThomasKranitsas incorporated the review comments, please check and approve if all is good

@bountyC0d3r bountyC0d3r merged commit 564a780 into topcoder-platform:develop Jan 5, 2023
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