From 6f0ea05f4bfb9abfa29731712349f71289085560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ken-H=C3=A5vard=20Lieng?= Date: Thu, 26 Apr 2018 21:19:47 +0200 Subject: [PATCH] Use shorter asset hashes --- server/serve_files.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/serve_files.go b/server/serve_files.go index 901e6343..cebc9445 100644 --- a/server/serve_files.go +++ b/server/serve_files.go @@ -70,7 +70,7 @@ func initFileServer() { } hash := md5.Sum(data) - files[0].Hash = base64.RawURLEncoding.EncodeToString(hash[:]) + files[0].Hash = base64.RawURLEncoding.EncodeToString(hash[:])[:8] files[0].Path = "bundle." + files[0].Hash + ".js" br, err := brotli.NewReader(bytes.NewReader(data), nil) @@ -94,7 +94,7 @@ func initFileServer() { } hash = md5.Sum(data) - files[1].Hash = base64.RawURLEncoding.EncodeToString(hash[:]) + files[1].Hash = base64.RawURLEncoding.EncodeToString(hash[:])[:8] files[1].Path = "bundle." + files[1].Hash + ".css" br.Reset(bytes.NewReader(data))