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

feat(html): cache bust static files by adding hashes to file names #1368

Merged
merged 10 commits into from
Feb 20, 2025

Conversation

notriddle
Copy link
Contributor

@notriddle notriddle commented Oct 28, 2020

Closes #1254
Fixes #2547

@notriddle notriddle force-pushed the hash-files branch 3 times, most recently from e0d5f2e to 9c07413 Compare October 28, 2020 06:45
@ehuss
Copy link
Contributor

ehuss commented Nov 11, 2020

Thanks! Can you provide an overview on how this works?

The documentation will also need to be updated.

@notriddle
Copy link
Contributor Author

I've added documentation for the new config option and handlebars helper. Is there any other particular thing that's confusing?

@notriddle notriddle force-pushed the hash-files branch 6 times, most recently from 9dd01f4 to f0727d0 Compare November 14, 2020 22:32
@notriddle
Copy link
Contributor Author

And fixed a Windows-specific bug in the test code.

@notriddle
Copy link
Contributor Author

Is this change okay? Is there some documentation that it still needs?

@KOBA789
Copy link

KOBA789 commented Apr 29, 2022

Thank you for the great patch! @notriddle
I need this feature too.
Could anyone review this PR?

@siddarthkay
Copy link

would be really cool if this feature made it into MdBook

@notriddle notriddle force-pushed the hash-files branch 2 times, most recently from 15b73f6 to de1dd2d Compare February 13, 2025 17:37
@notriddle
Copy link
Contributor Author

r? @ehuss @GuillaumeGomez

Okay, I've rebased this onto mainline again. I've also added support for cache-busting the toc.js file.

@ehuss
Copy link
Contributor

ehuss commented Feb 20, 2025

Thanks!

I pushed a few small changes.

I noticed that the paths for the no-js toc seem to be broken. Do these paths need to be updated? Would it be possible to update the sidebar-nojs.goml test to verify those are loading?

To make this work, I need to break the circular dependency and
stop hashing toc.html itself.
@notriddle
Copy link
Contributor Author

Yes, they do need updated.

I've pushed another commit that fixes this problem, and that enables hashed files in the GUI test, so it now covers this case.

Copy link
Contributor

@ehuss ehuss left a comment

Choose a reason for hiding this comment

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

Thanks!

@ehuss ehuss enabled auto-merge February 20, 2025 18:26
@ehuss ehuss added this pull request to the merge queue Feb 20, 2025
Merged via the queue into rust-lang:master with commit 98abb22 Feb 20, 2025
12 checks passed
@notriddle notriddle deleted the hash-files branch February 20, 2025 18:51
github-merge-queue bot pushed a commit to rust-lang/rust-clippy that referenced this pull request Mar 9, 2025
Currently, some parts of the
[website](https://rust-lang.github.io/rust-clippy/master/index.html)'s
CSS are not being applied. This seems to be due to a broken link to the
originally referenced CSS. I suspect
rust-lang/mdBook#1368.

changelog: none
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.

sidebar not refreshing without clearing cache Cache busting
5 participants