Response Compression at RPC Edge

Nischit Pradhan

We're excited to announce an important update to our RPC edge infrastructure at thirdweb. This enhancement is designed to improve performance and reduce costs for our users.

šŸš€ Whatā€™s New?

  • Response Compression at RPC Edge:
    Weā€™ve enabled response compression, meaning our RPC endpoints now deliver compressed responses to reduce data size and speed up transmission.
  • Cost Reduction for Users:
    With smaller payloads, users can enjoy reduced bandwidth usage and lower overall costs when interacting with our servers.
  • New Request Requirement:
    To take full advantage of this update, you need to add anĀ Accept-EncodingĀ header to your requests. This tells our servers that your client can handle compressed responses.

šŸ› ļø How to Use the New Feature

Simply include theĀ Accept-EncodingĀ header in your API requests. For instance, if you're calling theĀ eth_blockNumbermethod using our RPC endpoint, you can use the following curl example:

curl -H "Content-Type: application/json" \
-H "Accept-Encoding: gzip" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
https://1.rpc.thirdweb.com

In this example:

  • TheĀ Accept-Encoding: gzipĀ header signals that your client accepts gzip-compressed responses.
  • The JSON payload makes a call toĀ eth_blockNumberĀ to retrieve the latest block number.

šŸŽ‰ Conclusion

This update is part of our continuous effort to enhance performance and efficiency. Weā€™re committed to providing you with the best tools and infrastructure for your development needs. If you have any feedback or questions, please donā€™t hesitate to reach out.