thunderstore-io / Thunderstore

Thunderstore is a mod database and API for downloading mods. Thunderstore Discord: https://discord.thunderstore.io/
https://thunderstore.io/
GNU Affero General Public License v3.0
127 stars 28 forks source link

Various caching improvements #1002

Closed MythicManiac closed 7 months ago

MythicManiac commented 7 months ago

This PR includes changes that allow configuring multiple cache backends for distinctly separate use cases. This is a fairly simple approach to "sharding" the cache without setting up footguns that are easy to trip by accident. The downside however is that the developer must be explicit about the cache selection choice in the code.

Additionally this PR includes a dedicated caching mechanism to the profile sharing API endpoint, the main goal being to better isolate it from the rest of the service.

codecov[bot] commented 7 months ago

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (baffd21) 93.12% compared to head (ea247ac) 93.06%.

Files Patch % Lines
django/thunderstore/cache/utils.py 78.94% 4 Missing :warning:
...e/modpacks/api/experimental/views/legacyprofile.py 75.00% 2 Missing :warning:
...ango/thunderstore/modpacks/models/legacyprofile.py 92.00% 0 Missing and 2 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1002 +/- ## ========================================== - Coverage 93.12% 93.06% -0.06% ========================================== Files 307 308 +1 Lines 8811 8854 +43 Branches 782 784 +2 ========================================== + Hits 8205 8240 +35 - Misses 501 507 +6 - Partials 105 107 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.