Question

I want to use GZIP encoding to my site and how should . I set the content encoding of my html file to gzip.

T tried like this

<html lang="en" pageEncoding="gzip">

I am using Apache Tomcat web server.

Was it helpful?

Solution

You have confused content encoding (gzip, deflate) with page (aka character) encoding (ISO-8859-1, UTF-8, etc.).

In order to enable gzip compression on Apache Tomcat, you have to do it at the <Connector> level -- and only HTTP connectors are supported. See the compressableMimeType, compression, and compressionMinSize attributes for <Connector> in the Apache Tomcat HTTP Connector Configuration Reference

OTHER TIPS

Content compression is handled by the web server at the HTTP protocol layer. There are hints you can put in content itself to have the web server do things like this, but it's dependent on your server and the content. You can configure your web server to compress static content or dynamic content and if you're using something like PHP you can even do compression in your PHP code.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top