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

Have album art understand etags instead of using cache-control headers #2133

Open
gmerrall opened this issue Aug 4, 2021 · 0 comments
Open

Comments

@gmerrall
Copy link

gmerrall commented Aug 4, 2021

One of the issues with cache control is that it's time based and doesn't understand the concept of change. If you change folder art especially, your browser may not update art. This is also a problem since music browsing is an SPA so you can't easily refresh. You're kind of stuck waiting for the cache to clear or you need to clear your browser cache.

Can I suggest switching to eTags. eTags understand the concept of file change as an eTag is simply a hash of some property or properties of files (i.e. file content hash + file mtime). Serving an If-Match header associated with the eTag allows the browser to refresh the image at the time the file changes. I believe this would be a more suitable approach, especially when users are setting up or modifying their music library.

I do note that eTags are served in the response to /albumart which might be inserted by Express but should be possible to manage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant