6 Commits

Author SHA1 Message Date
d94b53c395 Merge pull request 'Update .goreleaser.yaml and enhance HTTP client settings in steamcache.go' (#10) from fix/connection-pooling into main
All checks were successful
Release Tag / release (push) Successful in 15s
Reviewed-on: s1d3sw1ped/SteamCache2#10
2025-07-19 09:13:37 +00:00
847931ed43 Update .goreleaser.yaml and enhance HTTP client settings in steamcache.go
All checks were successful
PR Check / check-and-test (pull_request) Successful in 18s
- 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.
2025-07-19 04:12:56 -05:00
4387236d22 Merge pull request 'Update .goreleaser.yaml to use hyphens in name templates for archives and releases' (#9) from fix/goreleaser-config-fix-really into main
All checks were successful
Release Tag / release (push) Successful in 21s
Reviewed-on: s1d3sw1ped/SteamCache2#9
2025-07-19 08:23:09 +00:00
f6ce004922 Update .goreleaser.yaml to use hyphens in name templates for archives and releases
All checks were successful
PR Check / check-and-test (pull_request) Successful in 9s
2025-07-19 03:22:08 -05:00
8e487876d2 Merge pull request 'Remove steamcache2 from the list of files in .goreleaser.yaml archives section.' (#8) from fix/goreleaser-config-fix into main
Some checks failed
Release Tag / release (push) Failing after 20s
Reviewed-on: s1d3sw1ped/SteamCache2#8
2025-07-19 08:04:40 +00:00
1be7f5bd20 Remove steamcache2 from the list of files in .goreleaser.yaml archives section.
All checks were successful
PR Check / check-and-test (pull_request) Successful in 9s
2025-07-19 03:02:39 -05:00
2 changed files with 10 additions and 23 deletions

View File

@@ -30,7 +30,7 @@ checksum:
archives: archives:
- id: default - id: default
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}" name_template: "{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}"
formats: tar.gz formats: tar.gz
format_overrides: format_overrides:
- goos: windows - goos: windows
@@ -38,7 +38,6 @@ archives:
files: files:
- README.md - README.md
- LICENSE - LICENSE
- steamcache2
changelog: changelog:
sort: asc sort: asc
@@ -48,8 +47,7 @@ changelog:
- "^test:" - "^test:"
release: release:
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" name_template: "{{ .ProjectName }}-{{ .Version }}"
footer: "Copyright (c) 2025 s1d3sw1ped"
gitea_urls: gitea_urls:
api: https://git.s1d3sw1ped.com/api/v1 api: https://git.s1d3sw1ped.com/api/v1

View File

@@ -222,16 +222,18 @@ func New(address string, memorySize string, diskSize string, diskPath, upstream,
} }
transport := &http.Transport{ transport := &http.Transport{
MaxIdleConns: 100, MaxIdleConns: 200, // Increased from 100
MaxIdleConnsPerHost: 10, MaxIdleConnsPerHost: 50, // Increased from 10
IdleConnTimeout: 90 * time.Second, IdleConnTimeout: 120 * time.Second, // Increased from 90s
DialContext: (&net.Dialer{ DialContext: (&net.Dialer{
Timeout: 30 * time.Second, Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second, KeepAlive: 30 * time.Second,
}).DialContext, }).DialContext,
TLSHandshakeTimeout: 10 * time.Second, TLSHandshakeTimeout: 15 * time.Second, // Increased from 10s
ResponseHeaderTimeout: 10 * time.Second, ResponseHeaderTimeout: 30 * time.Second, // Increased from 10s
ExpectContinueTimeout: 1 * time.Second, ExpectContinueTimeout: 5 * time.Second, // Increased from 1s
DisableCompression: true, // Steam doesn't use compression
ForceAttemptHTTP2: true, // Enable HTTP/2 if available
} }
client := &http.Client{ client := &http.Client{
@@ -453,18 +455,6 @@ func (sc *SteamCache) ServeHTTP(w http.ResponseWriter, r *http.Request) {
filename := filepath.Base(cacheKey) filename := filepath.Base(cacheKey)
expectedHash, hasHash := extractHashFromFilename(filename) 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 // Hash verification using Steam's X-Content-Sha header and content length verification
hashVerified := true hashVerified := true
if hasHash { if hasHash {
@@ -522,7 +512,6 @@ func (sc *SteamCache) ServeHTTP(w http.ResponseWriter, r *http.Request) {
Str("key", cacheKey). Str("key", cacheKey).
Str("host", r.Host). Str("host", r.Host).
Str("status", "MISS"). Str("status", "MISS").
Bool("hash_verified", hasHash).
Dur("duration", time.Since(tstart)). Dur("duration", time.Since(tstart)).
Msg("request") Msg("request")