Presumably the branch/tag/commit that's currently chosen is stored in the session. You can retrieve the size of a blob by running
git cat-file -s commit:path/to/file
and the tree object has a listing of the blobs and trees it references. I would think they could do this and store the results when a particular commit is chosen from the drop-down menu on the web page.