The MU forums have moved to WordPress.org

Compressing Javascript (2 posts)

  1. SteveAtty
    Member
    Posted 16 years ago #

    I've been reading round on the net and some people seem to suggest that putting SetOutputFilter DEFLATE in a .htaccess file in the js subdirectory will force Apache to automatically compress the javascript files.

    I've just checked my server and I've got the following set in my main httpd.conf file:

    SetOutputFilter DEFLATE
    DeflateFilterNote ratio
    SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|php)$ \
        no-gzip dont-vary
    SetEnvIfNoCase Request_URI \
        \.(?:exe|t?gz|zip|bz2|sit|rar)$ \
        no-gzip dont-vary
    SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary

    I was wondering just how much difference it will make on the large javascript files - I imagine they will compress quite well

  2. drmiketemp
    Member
    Posted 16 years ago #

    Probably but considering they should only be downloading one time when first requested, I wouldn't really worry about it. In theory at least.

    Maybe testing it on one of those Time My Site website testers might be of interest.

About this Topic

  • Started 16 years ago by SteveAtty
  • Latest reply from drmiketemp