Powered by Syntax Highlighter scripts!

Installing apache webserver locally and enabling gzip compression for json response on ajax calls

Tried installing the apache web server in my laptop,
First used the mod_jk connector to connect to local tomcat. (ref to link)
Then disabled the mod_jk connector and switched to use the mod_proxy connector to connect to local tomcat. (ref to link)

Goal of installing apache http server locally is to enable gzip compression for the site content.

Enabled compression in tomcat directly using the connector syntax below,

 Jersey REST Service

This worked fine as long as we use the port 8080, once we have the web server listening on port 80 infront of tomcat, the gzip compression is not enabled.
To get the gzip enabled on apache http server, added the line below to httpd-vhosts.conf file

AddOutputFilterByType DEFLATE text/html application/json text/plain text/xml text/javascript text/json text/x-js application/x-javascript application/javascript

This however is working for compression the response JSON for some ajax calls and not working for some ajax calls.

No comments: