HTTP compression #280
Replies: 5 comments 1 reply
-
Where is the documentation about gzip supports? |
Beta Was this translation helpful? Give feedback.
-
I could be wrong but I was under the impression all of Google's REST API's support gzip via e.g. client.addHeader("Content-Encoding", "gzip"); 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: 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.
-
It is not stated in the Firebase REST API documentation and don't trust AI for the result or that generic Cloud API doc because Firebase uses different Google API endpoints until you try it with any HTTP tool. Anyway, it will not support in this library in anytime soon. |
Beta Was this translation helpful? Give feedback.
-
ok, and if i do verify gzip works with firebase/firestore i'll let you know |
Beta Was this translation helpful? Give feedback.
-
I don't think it supports, and the Firebase team replies such question in the Google group that there is no plan almost 10 years ago and no information update. Currently gzip supports in Firebase products. (Gemini) Firebase leverages gzip compression in several of its services to optimize data transfer and storage:
1. Firebase Hosting:
Firebase Hosting automatically compresses your static assets (HTML, CSS, JavaScript, etc.) using either gzip or Brotli, depending on the client's capabilities and the content type. This happens automatically during deployment, and you do not need to manually gzip files or configure specific headers for compression.
2. Firebase Realtime Database Automated Backups:
Automated backups of your Firebase Realtime Database are compressed using gzip by default before being stored in Cloud Storage. This reduces storage costs and decreases the time required for backups. The resulting files will have a .gz suffix, and you can decompress them using tools like gunzip.
3. Firebase Cloud Storage:
When you upload files to Firebase Cloud Storage, you can upload them as gzip-compressed files. If the object's metadata includes Content-Encoding: gzip, Cloud Storage can perform "decompressive transcoding." This means the compressed version is stored, but the uncompressed version is served to requesters, optimizing both storage and delivery.
4. Firebase Cloud Functions:
While Firebase Cloud Functions do not automatically handle gzip compression for request bodies or responses, you can implement compression within your function code using libraries like compression for Node.js. This allows you to handle compressed data for specific use cases where it is beneficial. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Mobizt, since Firestore’s REST API supports gzip-compressed JSON payloads do you have any plans to add gzip support to the library? If not, would it be feasible to use your library's core functions but handle the encoding/decoding of the payloads manually?
Beta Was this translation helpful? Give feedback.
All reactions