Why is size of data transferred from server to client so much less than actual size of assets?

StackOverflow https://stackoverflow.com/questions/21219863

سؤال

I am developing a rails app in chrome and would like to figure out how much data is being sent from the server to the browser(chrome). When I look at the "Network" tab, chrome shows the size of every request and then at the bottom tells me the total amount transferred. It seems that the total amount transferred is the sum of the 'size' column. Directly underneath each size item is a greyed out 'content' which seems to be the actual size of the file on the server. So for example, I have an image that is 2 kB on the server but the amount transferred is only 235 bytes. What is going on here?

هل كانت مفيدة؟

المحلول

sprockets has an image compressor. I presume that is what's happening in your case.

https://github.com/botandrose/sprockets-image_compressor

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top