Welcome! Log In Create A New Profile

Advanced

How to enable gzip on ssi

Posted by ksbaskar 
How to enable gzip on ssi
January 23, 2019 12:20AM
Hello!

I need help in setting up gzip compression for server side included files.

I have enabled gzip compression in nginx.conf

This is the configuration that I have used
gzip on;
gzip_vary on;
gzip_disable "msie6";
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_min_length 256;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

I also have ssi on at the server block level.

When I check the response headers for SSI files, it does not show content-encoding header. However, when I check the response header for a .css file served from the same server, I get the content-encoding header.

Therefore, I get a "enable text compression" suggestion in Chrome lighthouse for the SSI files.

I have pasted the response headers

1. For the SSI file

alt-svc: clear
cache-control: no-cache
content-type: text/html
date: Wed, 23 Jan 2019 05:03:31 GMT
server: nginx/1.14.0 (Ubuntu)
status: 200
vary: Accept-Encoding
via: 1.1 google

2. For the CSS file

age: 386917
alt-svc: clear
cache-control: max-age=31536000,public, no-transform
content-encoding: gzip
content-length: 30438
content-type: text/css
date: Fri, 18 Jan 2019 16:30:06 GMT
expires: Sat, 18 Jan 2020 16:30:06 GMT
server: nginx/1.14.0 (Ubuntu)
status: 200
vary: Accept-Encoding
via: 1.1 google

Could you please help me solve this?

Thanks for your time.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 310
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready