SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
adjusting gzip logic
Chris Lu963082557600
diff --git a/weed-fs/src/cmd/weed/volume.go b/weed-fs/src/cmd/weed/volume.goindex 9696ffc852..259dbfded6 100644--- a/weed-fs/src/cmd/weed/volume.go+++ b/weed-fs/src/cmd/weed/volume.go@@ -105,7 +105,7 @@ func GetHandler(w http.ResponseWriter, r *http.Request) {if ext != "" {mtype := mime.TypeByExtension(ext)w.Header().Set("Content-Type", mtype)- if storage.IsCompressable(ext, mtype) {+ if storage.IsGzippable(ext, mtype) {if strings.Contains(r.Header.Get("Accept-Encoding"), "gzip") {w.Header().Set("Content-Encoding", "gzip")} else {diff --git a/weed-fs/src/pkg/storage/compress.go b/weed-fs/src/pkg/storage/compress.goindex d441db0090..2de5478690 100644--- a/weed-fs/src/pkg/storage/compress.go+++ b/weed-fs/src/pkg/storage/compress.go@@ -8,12 +8,12 @@ import ("strings")-func IsCompressable(ext, mtype string) bool {+func IsGzippable(ext, mtype string) bool {if ext == ".zip" {- return true+ return false}if ext == ".rar" {- return true+ return false}if strings.Index(mtype,"text/")==0 {return truediff --git a/weed-fs/src/pkg/storage/needle.go b/weed-fs/src/pkg/storage/needle.goindex 8f3a26ee6d..e352eb55d8 100644--- a/weed-fs/src/pkg/storage/needle.go+++ b/weed-fs/src/pkg/storage/needle.go@@ -40,7 +40,7 @@ func NewNeedle(r *http.Request) (n *Needle, fname string, e error) {if dotIndex > 0 {ext := fname[dotIndex:]mtype := mime.TypeByExtension(ext)- if IsCompressable(ext, mtype) {+ if IsGzippable(ext, mtype) {data = GzipData(data)}}