Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
What would be the benefit of client compressing the data? It would have to decompress it to use it anyway.
-
rocktim4604y@C0D4 Does the client automatically decompresses returned json ?? (ps: im new to this topic,just curious)
-
C0D4681384y@unicorndev as @alexbrooklyn said, use gzip or BR, almost any modern client will decompress on its own without your interference.
-
C0D4681384y@unicorndev as for the original question, do you need to?
If your hosting in cloud host (azure/aws), it would probably reduce your bill in the long run as you are sending less data, but if data isn't an issue... it falls under the "it's debatable", no harm in doing it even if you don't need to. -
rocktim4604y@C0D4 ah okey. And what about the speed. Doesn't compressing improve the overall speed of the api server when a client requests data?
-
C0D4681384y@unicorndev that's really dependant in the amount of data your throwing back, if your sending thousands of records back in a single call... sure it would help.
But the process behind the api would be the likely cause of a bottle neck to be concerned with or querying a database of some kind to retrieve the data in the first place.
The transmission it's self is just a single not so controllable stage of the process. Fetching and modelling the data quickly is going to be the beneficial part to optimise well. Just compress and send and let the client chock on it or request smaller payloads - granted you added pagination of some kind. -
rocktim4604y@C0D4 I see.Thanks again for the explanation.I was going to ask this in StackOverflow. I am glad I didn't lol. This is much better. love this 🌸
-
Voxera115854y@unicorndev one major difference in SO is that they generally frown upon discussions, answers should be answers which often cause down votes.
But SO had one major feature, searchable.
Answers here are much harder to find for others with the same question. -
rocktim4604y@Voxera Yes agreed. But It doesn't need to be SO. If you need any help finding a solution for an issue or how to work on something then google and SO is obviously there. But if you are curious about a topic and want to know a bit more about something then asking here is fine i guess. since most of the answers will be short and on point 🤗
Do we need compression on api level? say I have a rest api sending json data on requests. So if compression is needed then should it be in the server when returning the json response or in the client side when receiving it? which one is ideal?
rant
compression
javascript