Changelog¶
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased¶
- No changes here, yet!
4.5.0 - 2026-11-23¶
Changed¶
Accept-Encodinghandling now follows RFC 9110 qvalues: the acceptable variant with the highest qvalue is served (ties go to the smallest file), an explicitly requestedidentityis preferred when it has a higher qvalue than a compressed variant,x-gzipis treated asgzip, and the*wildcard is treated as accepting no codings. Header parsing is capped at 2048 bytes to avoid excessive work on attacker-controlled input.If-None-Matchhandling now follows RFC 9110 section 13.1.2: comparison is weak, soW/prefixes are ignored on both sides; the header may be*or a comma-separated list of entity tags; and opaque tags containing commas are parsed correctly. Header parsing is capped at 2048 bytes.- Common per-file header tuples (
Content-Type,Cache-Control,Vary,Content-Encoding, andAccess-Control-Allow-Origin) are now interned and shared between static files, reducing memory use on sites with many static files. The cache is bounded so per-file custom header values cannot grow it without limit. CompressedManifestStaticFilesStoragenow compresses hashed files first and copies those compressed variants for unhashed files whose contents are identical, avoiding a second compression pass whenever the hashed file produced variants.
Fixed¶
- The
servestaticCLI now exits with a non-zero status code when any file fails to hash or compress, and reports each error, including the file name, to standard error even when--quietis used. Previously, errors were only logged to standard output and the command still exited0, which hid failures from CI and build scripts. - Range requests now honour the
If-Rangeheader per RFC 9110 section 13.1.5. A strong entity tag must match exactly, weak entity tags never match, and a date must equalLast-Modified; otherwise the full representation is returned with200instead of a206, preventing clients from splicing ranges from different versions of a file. - Generated ETags are now independent of the server's time zone, so servers in different time zones produce the same ETag for the same file and
If-None-Match/If-Rangekeep working across them. ETags change once for servers not running in UTC. 416 Range Not Satisfiableresponses now carry onlyAccess-Control-Allow-Origin(plusContent-Range) instead of all base headers. Cache headers, validators, and content headers are omitted so caches do not store the error response..wofffiles are now served asfont/woff(matching nginx since 2018), andapple-app-site-associationfiles are served asapplication/json.collectstaticnow removes a previously generated.gz,.br, or.zstdvariant when compression of that encoding is no longer effective, so clients are not served stale compressed content under the current validators. Compressed files supplied as static sources are preserved rather than treated as stale variants.- Reusing a hashed file's compressed variants for an identical unhashed file no longer leaves behind stale variants from a previous run (for example a
.brfile when only gzip compression is still effective), which could otherwise be served with the unhashed file's current validators.
4.4.1 - 2026-11-14¶
Fixed¶
SERVESTATIC_IMMUTABLE_FILE_TESTis now honoured byServeStaticMiddleware. Previously the setting was read but ignored, because the middleware's manifest-based check never consulted the user-provided function or regex.
4.4.0 - 2026-10-02¶
Added¶
- Support the ASGI
http.response.pathsendextension for full-file sends. When the ASGI server advertises this extension (e.g. Granian), ServeStatic now offloads the file transmission to the server viapathsendinstead of streaming the file through Python file IO. Range (sliced) requests continue to stream overhttp.response.bodysincepathsendhas no slicing support. - Support the ASGI
http.response.zerocopysendextension (e.g. nonecorn or anycorn). When the ASGI server advertises this extension, ServeStatic offloads file transmission to the server viazerocopysend. Unlikepathsend,zerocopysendsupports slicing, so both full-file and Range (sliced) requests are transmitted zero-copy. When a server advertises both extensions,zerocopysendis preferred for performance reasons.
Changed¶
- Make the standalone ASGI/WSGI serving core compatible with the trio async backend. Thread-offload now detects the running async library (via sniffio, lazily and optionally) and dispatches to asyncio or trio, so ServeStatic no longer returns empty responses under trio-based servers (e.g. Anycorn
--worker-class trio).
4.3.4 - 2026-09-07¶
Fixed¶
- Prevent an unhandled
ValueErrorcrash when a request path contains a NUL byte (%00) that survives normalization, which could be triggered by an unauthenticated request to crash the server (DoS / log-flood).
4.3.3 - 2026-09-02¶
Changed¶
- Parse the
Accept-Encodingheader rather than matching it as a substring. A coding refused withq=0, such asgzip;q=0, is no longer served, and a coding is only offered when its name appears as a whole token.
Fixed¶
- Keep CORS / cache headers on
416(Range Not Satisfiable) and304(Not Modified) responses, so that cross-origin media probes are not broken.
4.3.2 - 2026-09-01¶
Changed¶
- Remove the redundant
packagingbuild dependency.
4.3.1 - 2026-06-06¶
- Fix manifest file mangling during
collectstaticdry run.
4.3.0 - 2026-04-09¶
Fixed¶
- Fix a bug where the Django
collectstaticcommand could crash when encountering static files that reference a URL containing query parameters.
4.2.0 - 2026-04-01¶
Added¶
- Added new Django setting
SERVESTATIC_USE_STATIC_ROOTto allow users to opt in to havingServeStaticscan all files withinSTATIC_ROOTat start-up. - Add JavaScript and CSS minification support to the
servestaticCLI command. - Add JavaScript and CSS minification support to Django.
4.1.0 - 2026-03-07¶
Tip
This release includes some changes to the default behavior of ServeStatic for security hardening. If you are affected by any of these changes, please read the relevant sections in the documentation on allow_unsafe_symlinks.
Added¶
- Added support for
zstdcompression on Python 3.14+. - Added support for the top-level
servestaticmodule to run as a Django app. - Added Django system checks to test for common misconfigurations.
- Added
allow_unsafe_symlinksconfiguration option for WSGI/ASGI - Added
SERVESTATIC_ALLOW_UNSAFE_SYMLINKSconfiguration option for Django. - Added
jxlimage support.
Changed¶
- Improved event-loop handling for ASGI file iterator.
- Installing
servestaticas a Django app is now the suggested configuration. A warning will appear if it is not detected inINSTALLED_APPSwhenDEBUGisTrue. servestatic.runserver_nostaticis no longer the recommended Django app installation path. This import path will be retained to easeWhiteNoisetoServeStaticmigration, but now the documentation recommends to use the top-levelservestaticmodule instead.
Fixed¶
- Fixed a range-request edge case where the last byte could be requested but would not be served.
Security¶
- Hardened
autorefreshpath matching to prevent potential path traversal or path clobbering. - Hardened static file resolution to block symlink breakout by default. If your symlinks point to files outside of your static root, it is highly recommended to copy them instead.
4.0.0 - 2026-03-05¶
Added¶
- Added
servestaticCLI command for creating manifests, hashing, and compressing for static files.
Changed¶
- Minimum python version is now 3.10.
immutable_file_testnow defaults to a regex matching the file name format generated byservestatic --hash(for exampleapp.db8f2edc0c8a.js).
Deprecated¶
- Calling the compression API via
python -m servestatic.compressis now deprecated. Please use theservestatic --compressCLI instead.
Fixed¶
- Fix race condition where
ServeStaticcould throw an exception when shutting down async file threads.
3.1.0 - 2025-06-10¶
Added¶
- Added support for running
ServeStaticin standalone WSGI/ASGI mode (without an app).
3.0.2 - 2025-06-03¶
Fixed¶
- Fixed a bug where
ServeStaticASGIwas preventing compatibility with thelifespanprotocol. All non-HTTP requests are now properly forwarded to the user's ASGI app.
3.0.1 - 2025-03-02¶
Fixed¶
- Fixed compatibility between the two following Django settings:
SERVESTATIC_KEEP_ONLY_HASHED_FILESandSERVESTATIC_USE_MANIFEST
3.0.0 - 2025-01-10¶
Changed¶
- Drop Django 3.2 and 4.1 support.
- Any errors from threads in the
servestatic.compresscommand are now raised. - Compression code has been refactored to match upstream (WhiteNoise).
Fixed¶
- Add
asgirefto dependencies to fix import error.
2.1.1 - 2024-10-27¶
Fixed¶
- Make sure WSGI
SlicedFileis closed properly to prevent subtle bugs.
2.1.0 - 2024-10-02¶
Added¶
- Support Python 3.13.
Changed¶
- Query strings are now preserved during HTTP redirection.
2.0.1 - 2024-09-13¶
Fixed¶
- Fix crash when running
manage.py collectstaticwhen Django'ssettings.py:STATIC_ROOTis aPathobject.
2.0.0 - 2024-09-12¶
Added¶
- Django
settings.py:SERVESTATIC_USE_MANIFESTwill allow ServeStatic to use the Django manifest rather than scanning the filesystem.- When also using ServeStatic's
CompressedManifestStaticFilesStoragebackend, ServeStatic will no longer need to callos.stat.
- When also using ServeStatic's
Changed¶
- Minimum python version is now 3.9.
- Django
setings.py:SERVESTATIC_USE_FINDERSwill now discover files strictly using the finders API. Previously, ServeStatic would also scansettings.py:STATIC_ROOTfor files not found by the finders API. - Async file reading is now done via threads rather than
aiofilesdue recent performance tests. BaseServeStatichas been renamed toServeStaticBase.AsgiFileServerhas been renamed toFileServerASGI.- Lots of internal refactoring to improve performance, code quality, and maintainability.
1.2.0 - 2024-08-30¶
Added¶
- Verbose Django
404error page whensettings.py:DEBUGisTrue
Fixed¶
- Fix Django compatibility with third-party sync middleware.
- ServeStatic Django middleware now only runs in async mode to avoid clashing with Django's internal usage of
asgiref.AsyncToSync.
- ServeStatic Django middleware now only runs in async mode to avoid clashing with Django's internal usage of
- Respect Django
settings.py:FORCE_SCRIPT_NAMEconfiguration value.
1.1.0 - 2024-08-27¶
Added¶
- Files are now compressed within a thread pool to increase performance.
Fixed¶
- Fix Django
StreamingHttpResponse must consume synchronous iteratorswarning. - Fix Django bug where file paths could fail to be followed on Windows.
1.0.0 - 2024-05-08¶
Changed¶
- Forked from
whitenoiseto add ASGI support.