0

YSlow keeps on telling me files like http://www.example.com/wp-content/plugins/q-and-a/css/q-a-plus.css?ver=1.0.6.2 are not gzipped while the gzip test tool at Feed the Bot mentions I am all good:

Compressed? Yes
Compression type    gzip
Page size (Bytes)   32,493
Compressed size (Bytes) -1
Saving (Bytes)  32,494
Compression %   100%

I added this to my .htaccess:

# Gzip

<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>

#Deflate

<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>

The header for the file mentioned states:

CF-Cache-Status MISS
CF-RAY  13945df90a9a0c1d-AMS
Cache-Control   public, max-age=2592000
Connection  keep-alive
Content-Encoding    gzip
Content-Type    application/javascript
Date    Thu, 12 Jun 2014 07:34:38 GMT
Expires Sat, 12 Jul 2014 07:34:38 GMT
Last-Modified   Thu, 21 Feb 2013 01:29:18 GMT
Server  cloudflare-nginx
Transfer-Encoding   chunked
Vary    Accept-Encoding

Is my code for gzipping correct here?

5
  • I assume me.com is in reality your own domain, not Apple's iCloud service? In that case, edit it to be example.com.
    – Sven
    Jun 12, 2014 at 7:55
  • I have adjusted the url @SvW . Yeah, it should be a dummy url. Have had this issue before, but now that I saw it again I want to deal with it once and for all.
    – rhand
    Jun 12, 2014 at 7:59
  • That "Feed the Bot" tool is obviously broken. Jun 12, 2014 at 14:31
  • Are you sure those headers are for the same file? "Content-Type: application/javascript" sounds rather odd for a CSS file. Jun 22, 2014 at 17:05
  • @HåkanLindqvist I have 12 files that are not gzipped according to YSlow and most are CSS. Almost all end with a version string ?ver=x. Another example of a CSS file not being gzipped according to YS is http://www.example.com/wp-content/plugins/q-and-a/css/q-a-plus.css?ver=1.0.6.2 Perhaps I need to add another mime handler or mime include besides the include line mod_gzip_item_include file .(html?|txt|css|js|php|pl)$?
    – rhand
    Jun 26, 2014 at 5:37

0

You must log in to answer this question.

Browse other questions tagged .