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

Load CSS and JS files with a cache-busting param (temp solution) #31

Merged
merged 1 commit into from
Jun 19, 2023

Conversation

brettimus
Copy link
Contributor

Might not be necessary given our setup, but I had this ready earlier in the week, figured I'd put it here for now

link.rel = "stylesheet";
link.href =
AM_ASSETS_HOST +
"/static/css/index.3527160e.css" +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine for now, but we should end up in the situation where we do not require a "cachebuster". Since that defeats the purpose of the cdn. (I actually think that this might not even work atm, since we're not forwarding the querystring values to the s3 bucket).

I think the eventual goal is to have each version of the css/js include its own unique hash (what I assume is happening right now), and cache those file to infinity. Then have a fixed path that will redirect the client to the latest version. This file will not be cached as long, and will be invalidated on every deploy. am will then include this fixed version in the source.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep that's what i saw as the end goal as well — in which case for the final release we'll switch back to using content hashes for autometrics-explorer (right now the hash values are unchanging bc of the cloudflare setup)

@brettimus brettimus merged commit 846a82d into main Jun 19, 2023
@brettimus brettimus changed the title WIP - Load CSS and JS files with a cache-busting param Load CSS and JS files with a cache-busting param (temp solution) Jun 19, 2023
@mellowagain mellowagain deleted the dynamically-load-css-and-js-with-cachebusting branch July 24, 2023 14:19
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

Successfully merging this pull request may close these issues.

2 participants