How to determine the size of a http response header?

apache, google-chrome-devtools, http-headers, size

Solution

I dont know what tool you need, but its easy to count in shell using curl utility, assuming you have following header:

root@sup ~# curl -I  http://domain.com
HTTP/1.1 200 OK
Server: nginx/1.2.1
Date: Thu, 05 Dec 2013 19:40:40 GMT
Content-Type: text/html
Content-Length: 199
Last-Modified: Sun, 15 Sep 2013 17:06:37 GMT
Connection: keep-alive
Accept-Ranges: bytes

to count it:

root@sup ~# curl -s -w \%{size_header} -o /dev/null http://domain.com 
215

result: 215 bytes.

Problem

I want to determine the size of the response header. I assume I could do so by subtracting the size of the response body from the combined size derived using Chrome DevTools. From Chrome DevTools: Size is the combined size of the response headers (usually a few hundred bytes) plus the response body, as delivered by the server. The uncompressed size of a .js file is 375 bytes, given by the `Content`. The combined `size` given by DevTools is 701 bytes. In addition, I have the following information from Apache access log to record the transfer of the same .js file: ``` %b = 273 bytes (Size of response in bytes, excluding HTTP headers) %O = 842 bytes (Bytes sent, including headers, cannot be zero) ``` Should I use `%0 - %b`, `%0 - Content`, `Size - %b` or `Size - Content`? In addition, can anyone tell me why there is a difference between `%0` and `Size`?

Original source