From b17cda8cac02283b69b47994b5e17c69d77126f4 Mon Sep 17 00:00:00 2001 From: Devika Shukla Date: Sun, 2 Nov 2025 12:19:06 +0530 Subject: [PATCH 1/2] docs: mention CRC32 checksum changes for add_js_file and add_css_file (7.1) --- doc/extdev/appapi.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/extdev/appapi.rst b/doc/extdev/appapi.rst index abf202e19b3..41ce1a2fb8a 100644 --- a/doc/extdev/appapi.rst +++ b/doc/extdev/appapi.rst @@ -68,8 +68,10 @@ package. .. automethod:: Sphinx.add_post_transform .. automethod:: Sphinx.add_js_file - +.. versionchanged:: 7.1 Added CRC32 checksums to asset URIs for improved caching and integrity. When JavaScript files are added, a CRC32 checksum is now appended to the URI (e.g. ``_static/example.js?abcd1234``). This helps browsers detect when files have changed and refresh cached versions automatically. For more details, see the 7.1.0 changelog entry: https://www.sphinx-doc.org/en/master/changes.html#release-7-1-0-released-jul-24-2023 Site authors can also use the configuration options :confval:`html_js_files` and :confval:`html_static_path` to manage static JS files. Files in ``html_static_path`` override those added by extensions. .. automethod:: Sphinx.add_css_file +.. versionchanged:: 7.1 +Added CRC32 checksums to asset URIs for CSS files as well, following the same caching and integrity improvements as :meth:`.Sphinx.add_js_file`.h:`.Sphinx.add_js_file`. .. automethod:: Sphinx.add_latex_package From 5b08a28723e790b3622c726a96e81028b70b4f5f Mon Sep 17 00:00:00 2001 From: Devika Shukla Date: Sun, 2 Nov 2025 13:23:08 +0530 Subject: [PATCH 2/2] docs: fix references and update API docs for add_js_file/add_css_file with CRC32 info --- doc/extdev/appapi.rst | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/doc/extdev/appapi.rst b/doc/extdev/appapi.rst index 41ce1a2fb8a..c2a14806cfb 100644 --- a/doc/extdev/appapi.rst +++ b/doc/extdev/appapi.rst @@ -67,12 +67,19 @@ package. .. automethod:: Sphinx.add_post_transform -.. automethod:: Sphinx.add_js_file -.. versionchanged:: 7.1 Added CRC32 checksums to asset URIs for improved caching and integrity. When JavaScript files are added, a CRC32 checksum is now appended to the URI (e.g. ``_static/example.js?abcd1234``). This helps browsers detect when files have changed and refresh cached versions automatically. For more details, see the 7.1.0 changelog entry: https://www.sphinx-doc.org/en/master/changes.html#release-7-1-0-released-jul-24-2023 Site authors can also use the configuration options :confval:`html_js_files` and :confval:`html_static_path` to manage static JS files. Files in ``html_static_path`` override those added by extensions. -.. automethod:: Sphinx.add_css_file -.. versionchanged:: 7.1 -Added CRC32 checksums to asset URIs for CSS files as well, following the same caching and integrity improvements as :meth:`.Sphinx.add_js_file`.h:`.Sphinx.add_js_file`. +.. automethod:: Sphinx.add_js_file + + .. versionchanged:: 7.1 + Added automatic CRC32 checksum for static files. + This ensures browsers reload updated JS assets automatically + instead of relying on manual cache clearing. +.. automethod:: Sphinx.add_css_file + + .. versionchanged:: 7.1 + Added automatic CRC32 checksum for static files. + This ensures browsers reload updated CSS assets automatically + instead of relying on manual cache clearing. .. automethod:: Sphinx.add_latex_package .. automethod:: Sphinx.add_lexer