Does parsed data improve speed
Hello, let's say I parse data this way. Does it make my website faster / lighter when I use this query in the frontend, because I return just the stuff I want?
And then create a router
And then create a router
2 Replies
The response from the network request will be slightly smaller, so you might save a couple of kb. I wouldn't do this just to save some data there.
However, validating the output, specially when the data comes from an external source is generally a good idea. https://twitter.com/alexdotjs/status/1589007455295397890
You can also validate the output by using
.output
and putting your schema in there: https://trpc.io/docs/v9/output-validationThx! Love your videos btw