REST API HTTP compression? #15178
Unanswered
mikeymike9000
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Does the Firebase/Firestore REST API support http gzip e.g.:
client.addHeader("Content-Encoding", "gzip");
client.addHeader("Content-Type", "application/json");
client.POST(compressedBuf, compressedLen);
https://cloud.google.com/resource-manager/docs/performance
Gemini blurbs:
Yes, Google's APIs, including the Firestore REST API, support gzip compression for responses. This is a standard feature of Google's API infrastructure and is not specific to Firestore itself, but rather to how you interact with any of their REST APIs.
Firestore REST API as a Server: The Firestore REST API is a robust service that supports standard HTTP features, including compression. It will likely send compressed data back to your ESP32 if you request it correctly.
In summary, for your ESP32 and Firestore REST API project, yes, you absolutely can and should consider compressing your JSON packets, especially for larger payloads. It's a standard feature of HTTP.
Example HTTP Request Header:
Accept-Encoding: gzip
When the Firestore REST API receives this header, it will compress the JSON payload of the response using gzip and send it back with a Content-Encoding header.
You might have a hard time finding a direct link in the official Firestore REST API documentation that explicitly says, "We support gzip." This is because it's a feature of the underlying Google API platform, not a unique Firestore-specific capability. The assumption is that you are familiar with standard HTTP practices.
However, you can find documentation on this for other Google APIs (like the Blogger API or BigQuery API), which confirms the standard practice across their services. The principles are the same for Firestore.
Beta Was this translation helpful? Give feedback.
All reactions