Express/Connect middleware to calculate the response payload size