Is it possible to use Cap'n Proto, to deserialize payloads instead of JSON, in Workers requests?

I'd like to know if anyone has been using Cap'n Proto to deserialize binary incoming requests payloads to a Worker before. I'm expecting a high volume of data and I'd need to optimize workers performance to avoid deserializing (and also serializing on the emitter side) from Json as text the payload of each request. I've seen that @kenton is the author of both Cap'n Proto and Workers and that these 2 are used underneath the CF architecture, but I was wondering if it's also possible to use a standalone lib for Workers that can achieve this. Researches didn't bring much information, and also JS libraries for Cap'n Proto are very outdated.
3 Replies
kenton
kenton4d ago
yeah unfortunately I'm not aware of a well-maintained JS library for Cap'n Proto. There are a couple projects people started and abandoned.
Hello, I’m Allie!
GitHub
GitHub - unjs/capnp-es: 🔥 TypeScript implementation of the Cap'n Pr...
🔥 TypeScript implementation of the Cap'n Proto serialization. - GitHub - unjs/capnp-es: 🔥 TypeScript implementation of the Cap'n Proto serialization.
mihaaai
mihaaaiOP3d ago
Awesome, this fixed problems with the older version! Thanks!

Did you find this page helpful?