You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add ETag handling and cache for pre-compressed .gz files
Add ETag handling and cache for pre-compressed .gz files in AsyncFileResponse
This patch improves AsyncFileResponse by adding ETag and cache support for pre-compressed .gz files.
Pre-compressed files (e.g., index.html.gz) were already being served when available. This update introduces automatic generation of an ETag for such files, based on the CRC32 checksum located in the gzip trailer (last 4 bytes).
When a .gz file from FS is served:
- An `ETag` header is included, derived from the gzip trailer CRC32
- A `Cache-Control: no-cache` header is added to ensure proper validation
This enhancement enables better caching and validation mechanisms for clients, improving efficiency while ensuring updated content is properly detected.
0 commit comments