Downloaded size is smaller than real size [closed]

I have deployed a website in my server by Nginx and CloudFlare. When I ssh the server and do ls -l over editor.main.js and editor.main.js.map, it shows that their size is 1778867 and 6379687 respectively.

However, when I check them in Google Chrome with Disable cache, I see their size is respectively 373K and 1.4M, which are smaller than real size. But the files look identical.

Does anyone know what’s happening?

enter image description here

https://www.funfun.io/monaco-editor/min/vs/editor/editor.main.js

https://www.funfun.io/monaco-editor/min-maps/vs/editor/editor.main.js.map

Answer

Google Chrome is showing data downloaded, and has negotiated gzip with the web server.

Request header:

accept-encoding: gzip, deflate, br

Response header:

content-encoding: gzip

I downloaded your file then gzip’d it manually. Original size 1778867, gzip’d size 407149 bytes at -9 compression level (393KiB) or 409186 bytes at default.

Not sure how your web server got it down to 373KB, maybe smarter compression software. WebPageTest reports it as 393KB as well.

Attribution
Source : Link , Question Author : Tie , Answer Author : Tim

Leave a Comment