Gzip not working for Xhr requests

Hi all,

The nginx server config file has gzip enabled and for most of the mime types gzip is working perfectly but unfortunately its not working for xhr requests (json) and that is causing a big delay. Can anybody help me out on this

These are the configurations.

gzip on;

gzip_http_version 1.1;

gzip_comp_level 5;

gzip_min_length 256;

gzip_proxied any;

gzip_vary on;

gzip_types application/atom+xml application/javascript application/json application/rss+xml application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/svg+xml image/x-icon text/css text/plain text/x-component; # text/html is always compressed by HttpGzipModule

how did you conclude that?

Check your nginx settings.


how did you conclude that?

I actually looked into the network tab of the google developer tool.
If you look into the response for xhr (json) there would be a content encoding field with gzip.

Well I manage to fix the issue with setting gzip_type as *.