mirror of
https://github.com/truewhile/MeBox.git
synced 2026-11-16 20:54:23 +08:00
优化
This commit is contained in:
@@ -17,12 +17,24 @@ var gzipExcludedExtensions = []string{
|
||||
|
||||
// apiGzipExcludedPrefixes 大文件流式传输(Range 语义)与 WS/SSE 长连接
|
||||
// 不参与 gzip:压缩会破坏 Range / 逐块推送语义。
|
||||
//
|
||||
// 阅读媒体代理(/api/reader/media、/api/reader/local/audio、
|
||||
// /api/reader/audio/transcode)同样必须排除,原因有两条:
|
||||
// - 它们透传上游的 206 Partial Content。gin-contrib/gzip 在压缩时会删掉
|
||||
// Content-Length,却把 Content-Range 原样留下,客户端看到的是「声明
|
||||
// N 字节、实际收到 M 字节的 gzip 流」,自己发 Accept-Encoding 的播放器
|
||||
// (ExoPlayer 不透明处理)直接判 ERROR_CODE_PARSING_CONTAINER_UNSUPPORTED。
|
||||
// - 音视频本来就是压缩格式,再 gzip 一遍只烧 CPU(3.5MB 的 m4a 压完还是
|
||||
// 3.5MB 量级),对带宽没有收益。
|
||||
var apiGzipExcludedPrefixes = []string{
|
||||
"/api/stream/",
|
||||
"/api/hls/",
|
||||
"/api/img",
|
||||
"/api/subtitles/",
|
||||
"/api/strm/play/",
|
||||
"/api/reader/media",
|
||||
"/api/reader/local/audio",
|
||||
"/api/reader/audio/transcode",
|
||||
"/api/ws",
|
||||
"/api/events",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user