googleapis / googleapis/google-cloud-node

Reduce bandwidth when using `preferRest`

Open
#7,453 1 comment 0 reactions 1 assignee Claimed by @MarkDuckworth View on GitHub
api: firestore library: nodejs-firestore priority: p3 type: feature request
Dominant language
TypeScript
Stars
3.2k
Forks
712
Avg merge
2d 3h
Merged PRs (30d)
99

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.