-
-
Notifications
You must be signed in to change notification settings - Fork 214
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
feat: Cache Cover Art Calls #3015
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I deployed to test.LB for in-situ testing, and it doesn't seem to be working for me.
I can see the stores in IndexedDB but it does not seem to store anything, the stores are empty, and going back and forth on two pages seems to call the CAA every time for all albums.
OK, so I see that the issue might be between my chair and my keyboard :) I was looking at my dashboard when testing, I didn't realize this was going to apply only to the release card. I tested again, and I'm still not sure it's working as expected.
For context, checking the indexedDB after all that, I see 13 entries only |
@@ -756,13 +757,23 @@ const getAlbumArtFromReleaseGroupMBID = async ( | |||
optionalSize?: CAAThumbnailSizes | |||
): Promise<string | undefined> => { | |||
try { | |||
const cacheKey = `rag:${releaseGroupMBID}-${optionalSize}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rag? Release Art Group?
When we're displaying the release card, if the props contain caaID and caaReleaseMBID, then the calls are directly made to archive.org using this function. In this case, we don't require caching anything. If we don't contain this information we're caching to reduce the 2 calls to coverartarchive.org, and saving the final image URL in the cache.
So, when you're testing on the artist page .These requests are to get the image from the URL. None of those requests are going to "fetch" the image URL from CAA.
If you want to further optimise the process, we'll need to cache the images themselves in the cache. |
OK, now I'm on your page ! Thanks for the further explanations. |
This PR Implements a client-side caching system for cover art using IndexedDB (with LocalStorage fallback) to improve performance and reduce server load. The system includes automatic cache expiration and cleanup mechanisms.