• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Deflate/Gzip don't work with Nginx or Apache

Pascal_DEVIF

New Pleskian
Hi,

Whatever i try to modify configuration there is no way i can get file delivered by apache or NGINX to be deflate/gzip compressed.

I've tried to add these lines to Nginx (Vhost directives) but it change nothing :
# Gzip Settings
gzip on;
gzip_buffers 16 8k;
gzip_comp_level 4;
gzip_http_version 1.1;
gzip_min_length 1100;
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/x-javascr$ application/xml application/xhtml+xml application/xml+rss;
gzip_vary on;
gzip_static on;
gzip_proxied any;
gzip_disable "MSIE [1-6]\.";


I also tried to disable Nginx and configure deflate in apache with following lines (Vhost directives then in a file in apache2/conf.d) but it is the same ...
<IfModule mod_deflate.c>
# Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
</IfModule>
</IfModule>
<IfModule filter_module>
# HTML, TXT, CSS, JavaScript, JSON, XML, HTC:
FilterDeclare COMPRESS
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/html
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/css
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/plain
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/xml
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/x-component
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/javascript
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/json
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/xml
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/xhtml+xml
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/rss+xml
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/atom+xml
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/vnd.ms-fontobject
FilterProvider COMPRESS DEFLATE resp=Content-Type $image/svg+xml
FilterProvider COMPRESS DEFLATE resp=Content-Type $image/x-icon
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/x-font-ttf
FilterProvider COMPRESS DEFLATE resp=Content-Type $font/opentype
FilterChain COMPRESS
FilterProtocol COMPRESS DEFLATE change=yes;byteranges=no
</IfModule>
<IfModule !mod_filter.c>
# Legacy versions of Apache
AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml
AddOutputFilterByType DEFLATE image/x-icon image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype
</IfModule>
</IfModule>


Some idea ?
 
module conf (deflate.conf) already contain this :

<IfModule mod_deflate.c>
# these are known to be safe with MSIE 6
AddOutputFilterByType DEFLATE text/html text/plain text/xml

# everything else may cause problems with MSIE 6
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/x-javascript application/javascript application/ecmascript
AddOutputFilterByType DEFLATE application/rss+xml
</IfModule>


So it should work even without extra configuration ... but no js, css or html are not compressed.
 
Hi and thanks.

With that config (think it mainly come from the file where parameters are written) it seems to be slightly better but it s strange.

The website : http://www.boutique-resine-epoxy.fr/

With web developper toolbar on Firefox it say one js (bigger one) is compressed but no others and neither css.
Yslow under Chrome say css are compressed but not js !

Very strange as usually we see same thing on both tools for compression.
Not easy to know if it run ok ...
 
Hi Pascal_DEVIF,

first of all: Your server is vulnerable. Please see the instructions and discussions and solve this issue in the first place!


In some cases you might experience issues with incompatibilities for some browser and/or eMail - clients, after you followed the KB - article 123 160. It might help to read:


... to solve such issues, because there are several additional solutions provided in this thread.


Second, please change your investigation tools, if the investigations are just wrong.

To check, if your domain uses compression, please use: curl -I -H 'Accept-Encoding: gzip,deflate' http://www.YOURDOMAIN.COM
... and see the results.

To understand why Google Page Speed, Yahoo YsLow and other sites may not be the best choice for your specific investigations, please read: http://dh42.com/blog/fastest-prestashop/


Third,
please be aware that this forum is a "Plesk related" - forum. How you configure your webcontent which is not part of Plesk, is your very own choice and can't be usefull discussed, because it really depends on your very own PrestaShop configuration and the used modules and sometimes server tweaking is as well a discussion point. If you use a combination of apache, nginx and FastCGI, please keep as well in mind, that apache-htaccess - configurations have to be converted to additional nginx directives, in order to work for nginx and FastCGI.
 
Hi UFHH01,

Thanks for your advices.
The fix for Poodle was normally already done on other files but i will add this one.
And whatever no SSL is used on this server.

For compression i will try your command to test.
I understand what is said about Yslow and Pagespeed and i agree, whatever it is first time results about gzip are so strange ... is it because Nginx used as reverse proxy ?

This article to boost server for prestashop is good, thks.
 
Back
Top