-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
DOC: Add cache busting to all static assets #23790
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
Conversation
We have seen both in `/stable` and `/3.6.0`, some styling is broken because old CSS is cached. CSS might change from updating sphinx-gallery, mpl-sphinx-theme, pydata-sphinx-theme, etc. Adding a versioned query breaks the cache. It's a bit over-eager to base it on Matplotlib version and not the file contents (since those dependencies may not have updated), but this should work well enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor question about "dev" vs "rel" releases. Feel free to merge if that is irrelevant here.
doc/conf.py
Outdated
# Sphinx setup | ||
# ----------------------------------------------------------------------------- | ||
def setup(app): | ||
if any(st in version for st in ('post', 'alpha', 'beta')): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "post" would still be considered release?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good question, but I just moved this code to the bottom of the file. It looks like that's how it was when it came in, 310b004 so maybe @tacaswell knows why
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we used to use .postN
to count the number of commits past the last tag, but we switch to using. .dev
for the number of commits on a pre-release of our expected next tag...but I think that means we need to add 'dev'
to this list as well?
Co-authored-by: Thomas A Caswell <tcaswell@gmail.com>
@QuLogic can self-merge when CI is green. |
…790-on-v3.6.x Backport PR #23790 on branch v3.6.x (DOC: Add cache busting to all static assets)
This is a copy of matplotlib/matplotlib#23790.
PR Summary
We have seen both in
/stable
and/3.6.0
(e.g., #23760), some styling is broken because old CSS is cached. CSS might change from updating sphinx-gallery, mpl-sphinx-theme, pydata-sphinx-theme, etc. Adding a versioned query breaks the cache.It's a bit over-eager to base it on Matplotlib version and not the file contents (since those dependencies may not have updated), but this should work well enough.
PR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).