Drupal, mod_deflate und YSlow: JS + CSS werden nicht komprimiert?

Bei der Überprüfung meiner Website mit dem Firefox Plugin YSlow musste ich feststellen, dass externe JavaScript und CSS-Dateien als nicht komprimiert angezeigt wurden, obwohl ich diese auf verschiedene Weisen per mod_deflate komprimiere.

Hier zum Abgleich meine mod_deflate Konfiguration:

AddOutputFilterByType DEFLATE text/* application/xml application/xhtml+xml application/x-javascript application/javascript application/json
##Add Deflate for CSS; Needed because mime type might be unclear

SetOutputFilter DEFLATE

BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0

Nachdem ich mir mit den verschiedenen Konfigurationsmöglichkeiten und der Lösungssuche "einen abgebrochen" hatte, stieß ich auf den folgenden Eintrag:
http://www.tipstrs.com/tip/14001/mod_deflate-not-compressing-Javascript-...

Lösung des Problems also (Zitat):

So if you think the CSS and Javascript files are not compressing as they should, you can use Web Developer to turn off caching by going to Disable -> Disable Caching. Once I did this, the files then showed up as compressed. A stupid mistake on my part, but I suspect others will run into it also. If you turn caching off, make sure you turn it back on when you are done or your web experience will get very slow.

Ich hoffe, dass ich euch damit vor dem selben Fehler bewahren konnte.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account associated with the e-mail address you provide, it will be used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Internal paths in single or double quotes, written as "internal:node/99", for example, are replaced with the appropriate absolute URL or path. Paths to files in single or double quotes, written as "files:somefile.ext", for example, are replaced with the appropriate URL that can be used to download the file.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd><blockquote>
  • Lines and paragraphs break automatically.
  • Pairs of<blockquote> tags will be styled as a block that indicates a quotation.
  • You can enable syntax highlighting of source code with the following tags: <c>, <cpp>, <css>, <drupal5>, <drupal6>, <java>, <javascript>, <mysql>, <php>, <python>, <ruby>, <smarty>, <xml>. The supported tag styles are: <foo>, [foo]. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.
  • Textual smileys will be replaced with graphical ones.
  • Each email address will be obfuscated in a human readable fashion or (if JavaScript is enabled) replaced with a spamproof clickable link.

More information about formatting options

Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.