[solved] Problem mit GZIP und Zencache

Ich habe im Sendegate schon nachgefragt, aber ich denke das Problem ist hier besser aufgehoben. Ich habe das Problem noch einmal komplett aufgearbeitet und zusammengefasst:

Ich habe in Wordpress das Zencache Plugin aktiviert.

Danach sagt feedvalidator.org:

Not a gzipped file (Server response declares Content-Encoding: gzip; misconfigured server?)

Auch der Podlove Feed Validator in Wordpress integriert validiert den Feed dann nicht mehr.

Der Feed lässt sich weiter im Browser problemlos öffnen.

Andere Feedvalidator haben keine Probleme: http://validaterssfeed.com/?url=http%3A%2F%2Fpodcast.funkenstrahlen.de%2Ffeed%2Fmp3%2F#tab=0

Dennoch habe ich Bedenken, dass Podcast Clients Probleme bekommen könnten.

Es macht keinen Unterschied ob ich in der .htaccess Datei GZIP aktiviere oder nicht.
Es macht keinen Unterschied ob ich in Zencache das Caching des Feeds aktiviere oder nicht.
Es macht einen Unterschied ob Zencache grundsätzlich aktiviert ist oder nicht (obwohl Caching des Feeds gar nicht aktiviert).

Der entsprechende Bereich in der .htaccess sieht so aus (wie gesagt ob der da ist oder nicht, scheint nichts zu ändern).

# Enable gzip compression
<IfModule deflate_module>
    <IfModule filter_module>
        AddOutputFilterByType DEFLATE text/plain text/html
        AddOutputFilterByType DEFLATE text/xml application/xml application/xhtml+xml application/xml-dtd
        AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml image/svg+xml
        AddOutputFilterByType DEFLATE text/css text/javascript application/javascript application/x-javascript
        AddOutputFilterByType DEFLATE font/otf font/opentype application/font-otf application/x-font-otf
        AddOutputFilterByType DEFLATE font/ttf font/truetype application/font-ttf application/x-font-ttf
    </IfModule>
</IfModule>

Ich habe dann mal nachgesehen, was eigentlich komprimiert wird und was nicht.
So sieht das aus, wenn ich in der .htaccess gzip aktiviert habe und Zencache aktiviert ist:

➜ curl -I -H 'Accept-Encoding: gzip,deflate' http://podcast.funkenstrahlen.de/feed/mp3
HTTP/1.1 200 OK
Date: Mon, 24 Aug 2015 21:21:19 GMT
Server: Apache/2.2.15 (CentOS)
X-Powered-By: PHP/5.6.10
X-Pingback: http://podcast.funkenstrahlen.de/xmlrpc.php
ETag: "ab21b4306e543edc3a5d5d7ac6716361"
Content-Encoding: gzip
Vary: Accept-Encoding
Last-Modified: Sun, 23 Aug 2015 17:00:38 GMT
Connection: close
Content-Type: application/rss+xml

➜ curl -I -H 'Accept-Encoding: gzip,deflate' http://podcast.funkenstrahlen.de
HTTP/1.1 200 OK
Date: Mon, 24 Aug 2015 21:21:23 GMT
Server: Apache/2.2.15 (CentOS)
X-Powered-By: PHP/5.6.10
X-Pingback: http://podcast.funkenstrahlen.de/xmlrpc.php
Connection: close
Content-Type: text/html; charset=UTF-8

Mich irritiert, dass der index selbst nicht komprimiert wird, obwohl das in htaccess aktiviert ist.

Diese Ausgaben ändern sich nicht, sobald ich Zencache deaktiviere oder in der .htaccess gzip deaktiviere.

Zencache sagt, sie haben mit gzip nichts zu tun:

ZenCache fully supports GZIP compression on its output. However, it does not handle GZIP compression directly. We purposely left GZIP compression out of this plugin, because GZIP compression is something that should really be enabled at the Apache level or inside your php.ini file.

Eine php.ini habe ich nicht. Extra nachgesehen.

Ich bekomme den Fehler nur, sobald Zencache aktiviert ist. Da beißt sich irgendwas. 343max hatte so ein Problem wohl auch schon einmal: How to disable gzip compression? · Issue #277 · podlove/podlove-publisher · GitHub

Ich betreibe die Seite auf Uberspace. Habe dort schon nachgefragt. Uberspace hält sich aus gzip raus. Sie machen, was ich konfiguriere.

Hm, das ist merkwürdig. Es gibt jedenfalls unsererseits keine Komponente, die unsererseits einfach irgendeinen Content-Encoding-Header setzen würde.

Ich bin ratlos. Was passiert da denn?

Das Problem is nun gelöst. Es bestand aus zwei Problemen.

Ich musste gzip Kompression von Podlove deaktivieren. Dazu habe ich in wp-settings folgende Zeile eingefügt:

add_filter('podlove_enable_gzip_for_feeds', function() { return false; });

Außerdem lässt sich auf Uberspace die gzip Kompression für php Software nicht via htaccess aktivieren, sondern nur über php.ini, siehe https://wiki.uberspace.de/webserver:htaccess#kompression

Nachdem das aktiviert war, funktioniert alles wie erwartet.

1 Like