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

Cache overviews by characterName and realm instead of raiderId #5

Open
LinusPhoenix opened this issue Feb 17, 2022 · 2 comments
Open
Labels
backend Affects the backend enhancement New feature or request

Comments

@LinusPhoenix
Copy link
Owner

If the same wow character is in raid teams A and B and there is a cached overview for that character in raid team A, requesting the overview of that character in raid team B will not use the cached version since the raiderId is different for the character in each raid team.

We do not store any raid-team specific information in the overview, so we can safely cache overviews on a per-character basis instead of a per-raider basis.

This would reduce the amount of requests that need to go to the Blizzard API.

@LinusPhoenix LinusPhoenix added enhancement New feature or request backend Affects the backend labels Feb 17, 2022
@karifrederiksen
Copy link
Collaborator

The getOverview method currently takes a raidTeamId and a raiderId as parameters, which are used to look up the character's name, realm, and region.

getOverview(
        @ReqUser() user: User,
        @Param("raidTeamId") raidTeamId: string,
        @Param("raiderId") raiderId: string,
        @Query("caching") useCaching: string,
    ): Promise<RaiderOverviewDto>

If RaiderOverviewDto only contains information available from Blizzard's API, then maybe we should change the parameters to characterName, realm, and region to simplify the lookup and caching logic.

@LinusPhoenix
Copy link
Owner Author

The only field preventing us from caching on character basis instead of raider basis is the raider's role in the team, which is already covered by the /raiders and /raiders/<raiderId> endpoints. We can remove that field and change the caching logic as desired.

Regarding the raid team and raider lookup, we could do this as well, however there is no tangible benefit yet to make the character overviews accessible outside of the raid team context, so I wouldn't do it yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Affects the backend enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants