-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(caa dims): separate cache key from full-size URL
In most cases, we can use the full-size URL as the cache key. However, for release groups, the full-size URL is the CAA-redirected front image. When the RG cover is changed, this URL stays the same, so the cache isn't invalidated properly. Also, for PDFs, we were using the derived JP2 URL as the cache key instead of the PDF URL itself. This change fixes both by separating the cache key from the image URL we query. For RGs, the cache key will now be the thumbnail URL, which will change if the RG cover is changed. Also reworked the tests to do better tests for these URL transformations and extractions. More work is needed there though, I think some of the earlier tests are doing duplicated work. Ideally, the URL transformation and extraction would be split off from the CAAImage class, but I didn't want to go into that much refactoring today. Unfortunately, the RG image cache won't be shared with the cache of the release images, since RGs use thumbnails as keys while releases use the full-size URL. We could fix this by changing the cache key to something like <release_id>/<image_id> but that would require a DB upgrade to transform existing entries, and would also make the cache specific to CAA/IA URLs. The latter probably isn't too big of a problem though.
- Loading branch information
Showing
3 changed files
with
179 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.