From 847931ed43f489eb7fa6a03921544e4cfd415042 Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Sat, 19 Jul 2025 04:12:56 -0500 Subject: [PATCH] Update .goreleaser.yaml and enhance HTTP client settings in steamcache.go - Removed copyright footer from .goreleaser.yaml. - Increased HTTP client connection settings in steamcache.go for improved performance: - MaxIdleConns from 100 to 200 - MaxIdleConnsPerHost from 10 to 50 - IdleConnTimeout from 90s to 120s - TLSHandshakeTimeout from 10s to 15s - ResponseHeaderTimeout from 10s to 30s - ExpectContinueTimeout from 1s to 5s - Added DisableCompression and ForceAttemptHTTP2 options. - Removed debug logging for manifest files in ServeHTTP method. --- .goreleaser.yaml | 1 - steamcache/steamcache.go | 27 ++++++++------------------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index b23e33a..08b2a12 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -48,7 +48,6 @@ changelog: release: name_template: "{{ .ProjectName }}-{{ .Version }}" - footer: "Copyright (c) 2025 s1d3sw1ped" gitea_urls: api: https://git.s1d3sw1ped.com/api/v1 diff --git a/steamcache/steamcache.go b/steamcache/steamcache.go index da882a2..5e2b87a 100644 --- a/steamcache/steamcache.go +++ b/steamcache/steamcache.go @@ -222,16 +222,18 @@ func New(address string, memorySize string, diskSize string, diskPath, upstream, } transport := &http.Transport{ - MaxIdleConns: 100, - MaxIdleConnsPerHost: 10, - IdleConnTimeout: 90 * time.Second, + MaxIdleConns: 200, // Increased from 100 + MaxIdleConnsPerHost: 50, // Increased from 10 + IdleConnTimeout: 120 * time.Second, // Increased from 90s DialContext: (&net.Dialer{ Timeout: 30 * time.Second, KeepAlive: 30 * time.Second, }).DialContext, - TLSHandshakeTimeout: 10 * time.Second, - ResponseHeaderTimeout: 10 * time.Second, - ExpectContinueTimeout: 1 * time.Second, + TLSHandshakeTimeout: 15 * time.Second, // Increased from 10s + ResponseHeaderTimeout: 30 * time.Second, // Increased from 10s + ExpectContinueTimeout: 5 * time.Second, // Increased from 1s + DisableCompression: true, // Steam doesn't use compression + ForceAttemptHTTP2: true, // Enable HTTP/2 if available } client := &http.Client{ @@ -453,18 +455,6 @@ func (sc *SteamCache) ServeHTTP(w http.ResponseWriter, r *http.Request) { filename := filepath.Base(cacheKey) expectedHash, hasHash := extractHashFromFilename(filename) - // Debug logging for manifest files - if strings.Contains(cacheKey, "manifest") { - logger.Logger.Debug(). - Str("key", cacheKey). - Str("filename", filename). - Bool("hasHash", hasHash). - Str("expectedHash", expectedHash). - Int64("content_length_header", resp.ContentLength). - Int("actual_content_length", len(bodyData)). - Msg("Manifest file hash verification debug") - } - // Hash verification using Steam's X-Content-Sha header and content length verification hashVerified := true if hasHash { @@ -522,7 +512,6 @@ func (sc *SteamCache) ServeHTTP(w http.ResponseWriter, r *http.Request) { Str("key", cacheKey). Str("host", r.Host). Str("status", "MISS"). - Bool("hash_verified", hasHash). Dur("duration", time.Since(tstart)). Msg("request")