Skip to content

Implement hashing for CSS filenames #789

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

Merged
merged 1 commit into from
May 28, 2019
Merged

Conversation

skade
Copy link
Contributor

@skade skade commented May 21, 2019

Based on @ashleygwilliams work in #544

Uses lazy_static as threading this through as state is painful, as catchers and routes have a different interface here.

Fixes #539

@skade
Copy link
Contributor Author

skade commented May 25, 2019

Rebased on current master.

Copy link
Member

@pietroalbini pietroalbini left a comment

Choose a reason for hiding this comment

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

CSS is not the only kind of asset that will need to be hashed: we have some JavaScript in the repo as well (static/scripts/tools-install.js) and if we want to add the caching headers that file needs the hash in its name. What I'd like to see for this PR is a big rename of everything to a more generic AssetsNames (bikeshedding welcome) and JavaScript hashing.

There are also a bunch of extra files in the PR that should be removed, like the compiled styles that were previously ignored and some other files that I guess were added by mistake.

@skade
Copy link
Contributor Author

skade commented May 28, 2019

@pietroalbini implemented and rebased.

I called the js file app_<hash>.js, even though it's currently only used on the install page. If we need more JS at other places in the page, it probably still makes sense to ship it as one in one go instead of per page, I found the name more fitting there.

@pietroalbini
Copy link
Member

Thanks!

@pietroalbini pietroalbini merged commit bc9298e into rust-lang:master May 28, 2019
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.

name custom css file with sha to unblock caching
2 participants