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

Fix/cache polution issue #18

Merged
merged 4 commits into from
May 16, 2024
Merged

Fix/cache polution issue #18

merged 4 commits into from
May 16, 2024

Conversation

Thavarshan
Copy link
Owner

Purpose

This PR addresses the issue of cache pollution that occurs when too many unique keys are generated, causing the cache to fill up with data that is rarely used. This is in response to the problem described in issue #17.

Approach

The solution involves modifying the buildCacheKey method to sort and normalise the filterables before generating the cache key. This ensures that the same set of filterables, regardless of their order, will always generate the same cache key. This change is intended to reduce the number of unique keys and mitigate cache pollution issues.

Learning

During the research stage, it was discovered that cache pollution often occurs when too many unique keys are generated. One way to mitigate this is to limit the number of unique filter combinations that can be cached. This can be done by sorting and normalising the filterables before generating the cache key. This approach is implemented in this PR.

@Thavarshan Thavarshan added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request dependencies Pull requests that update a dependency file labels May 16, 2024
@Thavarshan Thavarshan self-assigned this May 16, 2024
@Thavarshan Thavarshan linked an issue May 16, 2024 that may be closed by this pull request
@Thavarshan Thavarshan merged commit c1e4c21 into main May 16, 2024
2 checks passed
@Thavarshan Thavarshan deleted the fix/cache-polution-issue branch May 16, 2024 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cache pollution issue when switching between query parameters
1 participant