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

Use content hashes for client-side cache purging of images #142

Open
vipulnaik opened this issue Sep 8, 2022 · 0 comments
Open

Use content hashes for client-side cache purging of images #142

vipulnaik opened this issue Sep 8, 2022 · 0 comments
Assignees

Comments

@vipulnaik
Copy link
Owner

vipulnaik commented Sep 8, 2022

We see an issue sometimes where when an image (e.g., for one of the time series charts) updates server-side due to new data, the client still loads an old version of the image from the browser cache. For the most part, we do want to continue benefiting from browser caching of data, so here's a potential idea:

  • Calculate a md5 or such hash of the content of the file.
  • Add a url parameter to the content that is based on that hash, so that it automatically changes when the content changes. This will force a reload of that item if and only if the content is expected to have changed, so in the cases where the underlying content hasn't changed, we'll still end up using the old version of the item without making a network call.
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