Web Performance - Request Overhead

Web Performance - Request Overhead


Every time a client sends an HTTP request, it has to send all associated cookies that have been set for that domain and path along with it; adding the factor that HTTP request headers are sent uncompressed, increasing the latency and getting higher at the beginning of a new browser session. To minimize net congestion, TCP employs the slow start algorithm for new connections; this limits the amount of data that can be sent by the initiator of the connection before the data must be acknowledged by the recipient. If the initiator sends more than that amount of data over a new connection, an additional Round-Trip Time is incurred.

Extracted from the Make the Web Faster Google’s project.

Minimize request size

One way to cut down client request time is reducing the number of bytes uploaded as request header data keeping cookies and request headers as small as possible ensures that an HTTP request can fit into a single packet limited widely by the most used networks to approximately 1500 bytes per packet, so constraining each request size less than 1500 bytes can reduce the Overhead of the request stream.

  • Keep cookie size less than 1000 bytes and between the average size of 400 bytes; avoiding duplicated cookie fields and removing unused.
  • Limit URL string lengths to a few of hundred bytes at most avoiding URLs with multiple parameters.
  • Put attention to the HTTP_REFERER header using it properly.

Web Performance Request Overhead 1

Cookie-less domain

Static contents such as images, Javascript and CSS files don’t need to be accompanied by cookies, as there is no interaction with these resources; decrease request latency by serving static resources from a domain (or sub-domain) that doesn’t serve cookies. Additionally, don’t serve early loaded external files (such a Javascript) from a cookie-less domain, it should be served from the same hostname as the main document, because most browsers block other downloads and rendering until all these files have been downloaded, parsed and executed.

Web Performance Request Overhead 2

Do you have a project idea? Let's make it together!