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

Implement cache busting: append a suffix to CSS and JS URLs #3018

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

oprypin
Copy link
Contributor

@oprypin oprypin commented Oct 21, 2022

See docs in the diff.

Try it out:

pip install git+https://github.com/mkdocs/mkdocs.git@refs/pull/3018/head

@oprypin oprypin changed the base branch from weak to mjs June 18, 2023 21:24
@oprypin
Copy link
Contributor Author

oprypin commented Jun 18, 2023

I slightly reworked the PR and I'm planning to move forward with it, after some polishing.

Base automatically changed from mjs to master June 19, 2023 05:58
@oprypin
Copy link
Contributor Author

oprypin commented Jul 2, 2023

How the options are currently named and what they are trying to express:

  • hash_rename_assets: Patterns of filenames of assets that will be renamed by inserting a hash to the filename
  • hash_append_assets: Patterns of filenames of assets that will always be linked by appending a query parameter with a hash

These names are really bad. Does anyone have ideas?

@pawamoy
Copy link
Sponsor Contributor

pawamoy commented Jul 2, 2023

cache_busting_[with]_hash/query? 🤷

@ultrabug
Copy link
Member

ultrabug commented Jul 5, 2023

If we consider that we add the hash to either the filename or the url, here are a few names that come in mind:

  • use_hash_filename
  • use_hash_url

  • add_hash_filenames
  • add_hash_urls

  • hash_add_filenames
  • hash_add_urls

or simply

  • hashed_filenames
  • hashed_urls

Not sure which one I prefer yet...

@kamilkrzyskow
Copy link

I like Ultrabug's last 2 options, however I fear that using url could be a bit confusing because users might input urls...

Since it's a list of patterns of paths to extras it might be something like:
extras_hashed_via_rename and (extras_hashed_via_query or extras_hashed_via_param) 😄
or make it shorter removing the extras_ part,
hashed_via_rename and (hashed_via_query or hashed_via_param)
or even shorter
hash_via_rename and (hash_via_query or hash_via_param)

But then could it be confused for hashing the files themselves? 😵
Anyways, just my 2 cents ✌️

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.

Cache Busting
5 participants