fabric-meta
fabric-meta copied to clipboard
Pretty printing
Why pretty printing?
( public static Gson GSON = new GsonBuilder().setPrettyPrinting().create();
I mean this is an api...that gets used by probably bots and not humans. It increases traffic and file sizes (for them, who download it). Also it affects performance.
Has this an intention?
I'd think about an extra parameter like ?pretty=true that is false by default.
Yes, its easier to read, the overhead for having it is basically nothing. Having it as an option would lower the cache hit raito so would be worse imo.
It's not nothing, that json is ~550kb and minified around 380. That makes a difference.
But I agree, it is far more readable.
Yes, it would make caching worse, but probably not that much... Probably most people (can) use it minified.
Prettifying is not needed. The bandwidth overhead is not nothing, and having the user do so when prettifying is easy.
On Visual Studio Code, it's a single keybind, and on browsers such as Firefox, a prettified view is generated automatically when receiving JSON.
Chromium-based browsers will pretty print API responses in version 113
No need