Web Page Size Using Java
How to get the we开发者_运维技巧b page size from an url in bytes. This should include all images. How can we do that. Any help Thanks in Advance
The way to find the number of bytes used to represent a web page you would need to:
- fetch the HTML page and all images, scripts, CSS files, etc that it references, transitively,
- evaluate any embedded scripts (as per the HTML spec) to see if they pull in further resources, and
- sum the byte counts for all resources loaded to give the "web page size".
But I don't see what you would learn by doing this. For instance, the web page size (as above) is not a good predictor of network usage.
You say:
I am doing this to analyze the performance of an web page.
A better way would be to use something like the "yslow" plugin for Firefox.
精彩评论