Gzip aktivieren - ngnix yslow

lodvandan

New Member
Guten Tag liebe Server Support Gemeinde.

Ich habe eine Verständnisfrage zum Gzip.
Auf den früheren Managed Server war der Gzip Test unter Yslow
immer Positiv, wenn die htaccess korrekt angepasst wurde.

Code:
<IfModule mod_expires.c>
ExpiresActive On 
ExpiresDefault "access plus 1 seconds"
ExpiresByType image/x-icon "access plus 604800 seconds"
ExpiresByType image/jpeg "access plus 604800 seconds"
ExpiresByType image/png "access plus 604800 seconds"
ExpiresByType image/gif "access plus 604800 seconds"
ExpiresByType image/ico "access plus 604800 seconds"
ExpiresByType application/x-shockwave-flash "access plus 432000 seconds"
ExpiresByType text/css "access plus 432000 seconds"
ExpiresByType text/javascript "access plus 432000 seconds"
ExpiresByType application/x-javascript "access plus 432000 seconds"
ExpiresByType text/html "access plus 600 seconds"
ExpiresByType application/xhtml+xml "access plus 600 seconds"
</IfModule>

##
# Disable ETags
# @see http://developer.yahoo.com/performance/rules.html#etags
##
FileETag None
<IfModule mod_headers.c>
  Header unset ETag
</IfModule>

<IfModule mod_deflate.c> 
<FilesMatch "\.(css|js|x?html?|php)$"> 
SetOutputFilter DEFLATE 
</FilesMatch> 
</IfModule>

Die gleiche htacces verwenden wir nun auf dem Dedicated server,
jedoch wird unter yslow Note (F) ausgegeben.
Was mich aber wundert ist, das manche Javascript Files dennoch gezipt werden.

Andere Online Gzip Checks zeigen, das die Seite Gzip verwendet,
denke das liegt daran, das teilweise es ja auch so ist.

Yslow und pagespeed zeigen "deaktiviert"

zum selberschauen - Testshop: shop481.lavedo.de

Meine Frage lautet, wie man die Einstellung so hinbekommt, das
gzip komplett wieder funktioniert.


Beste Grüße

Lod

Anhänge:

2 x yslow test - 1. funktioniert 2. funktioniert nicht (mit Headerangaben)
2 x Server config 1 x ngnix & 1 x Apache
 

Attachments

  • yslow gzip funktioniert.jpg
    yslow gzip funktioniert.jpg
    34.6 KB · Views: 150
  • yslow gzip funktioniert_nicht.jpg
    yslow gzip funktioniert_nicht.jpg
    38.4 KB · Views: 167
  • httpd_conf.jpg
    httpd_conf.jpg
    75.4 KB · Views: 142
  • ngnix_conf.jpg
    ngnix_conf.jpg
    35.4 KB · Views: 152
  • komplett.jpg
    komplett.jpg
    146.1 KB · Views: 153
Last edited by a moderator:
Guten Tag,

habe es jetzt hinbekommen,
der unten stehende Code musste noch in die nginx.conf
eingetragen werden (ganz unten)

Code:
gzip on;
gzip_comp_level 9;
gzip_http_version 1.1;
gzip_proxied any;
gzip_min_length 10;
gzip_buffers 16 8k;
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript application/xhtml+xml;

Quelle: http://alpha-computer-services.acsh...ginx-on-plesk-centos-cloudlinux/#.VOI9kS6QAeM


Grüße
 
Last edited by a moderator:
Hm? Diese Direktiven gehören in eine .htaccess, aber sicher nicht in eine NGINX-Config. Wenn du einen NGINX vor dem Apache hast, sollte dieser komprimieren, nicht umgekehrt.
 
Hier findest du die korrekte Nginx-Konfiguration:
http://nginx.org/en/docs/http/ngx_http_gzip_module.html

Eine mögliche Zeile wäre:
Code:
gzip_types              text/plain text/css image/svg+xml application/json application/x-javascript application/javascript text/xml application/xml application/
xml+rss text/javascript;
Natürlich bedarf es noch anderer Konfigurationsoptionen wie gzip_disable, gzip_min_length, gzip_buffers ...
 
yup laut Quellenangabe ist es die richtige Vorgehensweise,
habe den falschen code gepostet, jedoch ist die Quelle korrekt und
der Lösungsansatz ebendfalls.

btw -> Post oben wurde korregiert.

Grüße
 
Back
Top