From 9871cd25b23c6ae20590c06515a0efcfda42a207 Mon Sep 17 00:00:00 2001 From: Erik Gomez Date: Thu, 11 Jul 2024 09:53:50 -0500 Subject: [PATCH] add compression to potentially reduce SOFA bw --- Nudge/3rd Party Assets/sofa.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Nudge/3rd Party Assets/sofa.swift b/Nudge/3rd Party Assets/sofa.swift index cee37fde..5e1bf548 100644 --- a/Nudge/3rd Party Assets/sofa.swift +++ b/Nudge/3rd Party Assets/sofa.swift @@ -232,6 +232,7 @@ class SOFA: NSObject, URLSessionDelegate { request.addValue("\(Globals.bundleID)/\(VersionManager.getNudgeVersion())", forHTTPHeaderField: "User-Agent") request.setValue(lastEtag, forHTTPHeaderField: "If-None-Match") // TODO: I'm saving the Etag and sending it, but due to forcing this into a syncronous call, it is always returning a 200 code. When using this in an asycronous method, it eventually returns the 304 response. I'm not sure how to fix this bug. + request.addValue("gzip, deflate, br", forHTTPHeaderField: "Accept-Encoding") // Force compression for JSON var attempts = 0 var responseData: Data?