Reduce bandwidth when using preferRest
#2082
Labels
api: firestore
Issues related to the googleapis/nodejs-firestore API.
priority: p3
Desirable enhancement or fix. May not be included in next release.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
I recently discovered that the Firestore REST API serves JSON responses in a "pretty printed" format with newlines, indentation etc. I also discovered that the REST API also has a
prettyPrint
query parameter that can opt in to non-pretty printing format, see https://firestore.googleapis.com/$discovery/rest?version=v1.I found that using
?prettyprint=0
can save up to 50% of the JSON response size (probably less when considering compression) due to the highly nested (and therefore indented) nature of Firestore response data structures.However this may affect how the underlying libraries (gax?) do streaming parsing (if they do so?). I don't know enough about how the underlying I/O libraries are structured to know the impact or complexity, or even if you're not disabling pretty print already... I just did a quick search and couldn't find any reference to it.
I'll just leave this here for consideration.
The text was updated successfully, but these errors were encountered: