Book Image

Mastering ServiceStack

By : Andreas Niedermair
Book Image

Mastering ServiceStack

By: Andreas Niedermair

Overview of this book

Table of Contents (13 chapters)

Minimizing the footprint of HTTP requests


One possible approach to minimize the overall demand of resources of a web service is to shrink the HTTP footprint. Each established connection uses valuable resources, which makes a conversion to batching requests a possible solution. Additionally, you can also try to minimize the amount of transmitted data by adding compression or using a more advanced format. However, always keep the additional CPU time needed for compression and advanced serialization in mind, which might excel the benefit of saved transferred bytes.

Batching requests

To further improve performance for classic O(n) operations, implicit auto batching is available with all ServiceStack .NET clients. This minimizes the amount of requests needed, minimizes latency, and also optimizes potential requests to a database (for example, by acquiring only one transaction instead of multiple).

To make use of automatic request batching, you can use any of the SendAll methods available on the...