0

I have the following code in my .htaccess file:

# BEGIN Mod_expires
ExpiresActive On
ExpiresDefault "access plus 1 week"
# END Mod_expires

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

<IfModule mod_headers.c>
  <FilesMatch "\.(js|css|xml|gz)(\?[a-z]*=[\w\.]*$)*">
    Header append Vary: Accept-Encoding
  </FilesMatch>
</IfModule>
# END GZIP

It's gzipping everything perfectly, except for the following file:

http://www.example.com/wp-content/themes/css_theme/js/jquery.flexslider-min.js

I tried messing around with the REGEX, but with little success.

How can i also gzip the above mentioned file?

Joey
  • 1,664
  • 3
  • 19
  • 35

1 Answers1

0

The type for the JavaScript file in question is likely text/javascript, which is not in your AddOutputFilterByType list.

As mentioned, you can verify this by looking at the response headers.

Learn more - When serving JavaScript files, is it better to use the application/javascript or application/x-javascript

Community
  • 1
  • 1
Jason McCreary
  • 71,546
  • 23
  • 135
  • 174
  • Content type is `application/x-javascript`. Edit: I have however noticed that some of my other files that use a period in the filename, also don't get gzipped, like: /jquery.flot.min.js. Perhaps this is a REGEX issue? – Joey Nov 15 '12 at 19:12
  • I'd still add it for legacy sake. Also, remove your header modification and see if it works. That would prove it's not a gzip problem. – Jason McCreary Nov 15 '12 at 19:18
  • Its been added. I just removed the header modification and it seems as though nothing has changed. That file is still the only file not being gzipped. – Joey Nov 15 '12 at 19:22