How To Understand A Website Is Using Gzip Compression?
I am trying to check any website is using gzip or not? I found this explanation on Nibbler, We check if pages use GZIP compression for smaller page sizes and faster downloading
Solution 1:
Open chrome Developer Tools
Go to the "Network" tab and reload the page.
Choose the appropriate page/file on the left
then the "Headers" tab on the right pane.
Under "Response Headers" you should see "Content-Encoding: gzip"
Solution 2:
URL uri = newURL(url);
HttpURLConnection connection = (HttpURLConnection) uri.openConnection();
connection.setRequestProperty("Accept-Encoding","gzip");
Map<String, List<String>> map = connection.getHeaderFields();
for (Map.Entry<String, List<String>> entry : map.entrySet()) {
System.out.println("Key : " + entry.getKey() +
" ,Value : " + entry.getValue());
}
Content-Encoding with value []
will be printed.
Post a Comment for "How To Understand A Website Is Using Gzip Compression?"