Skip to content

Commit

Permalink
add compression to potentially reduce SOFA bw
Browse files Browse the repository at this point in the history
  • Loading branch information
erikng committed Jul 11, 2024
1 parent ba31645 commit 9871cd2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Nudge/3rd Party Assets/sofa.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down

0 comments on commit 9871cd2

Please sign in to comment.