Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Compress css and js files with mod_gzip/mod_deflate - need help for apache 1.3

edited September 2007 in Vanilla 1.0 Help
TomTester posted yesterday the directive to compress css and js with mod_deflate.
I am trying to write one that would also work with apache 1.3.x. Can someone test on apache 1.3.x this version:<IfModule mime_module> <files *.js> ForceType text/javascript </files> <files *.css> ForceType text/css </files> </IfModule> <IfModule headers_module> <IfModule deflate_module> # Netscape 4.x BrowserMatch ^Mozilla/4 no-gzip # For browsers that pretend to be Mozilla4 BrowserMatch \b(MSIE|Safari) !no-gzip # IE5.5 and 6.0 has bugs BrowserMatch \bMSIE\s(5\.5|6\.0) no-gzip # IE 6.0 after SP2 may not have gzip bugs! BrowserMatch \bMSIE.*SV !no-gzip # Sometimes Opera pretends to be IE6 BrowserMatch \bOpera !no-gzip AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE text/javascript Header append Vary User-Agent </IfModule> </IfModule> <IfModule gzip_module> mod_gzip_on Yes mod_gzip_item_exclude reqheader "User-agent: Mozilla/4" mod_gzip_item_include reqheader ^User-agent\:.*\b(MSIE|Safari) mod_gzip_item_exclude reqheader ^User-agent\:.*\bMSIE\s(5\.5|6\.0) mod_gzip_item_include reqheader ^User-agent\:.*\bMSIE.*SV mod_gzip_item_include reqheader ^User-agent\:.*\bOpera mod_gzip_item_include file \.html$ mod_gzip_item_include file \.js$ mod_gzip_item_include file \.css$ mod_gzip_item_include mime ^text/html$ mod_gzip_item_include mime ^text/css$ mod_gzip_item_include mime ^text/javascript$ mod_gzip_item_exclude mime ^image/ </IfModule>

I not sure and all the mod_gzip_item_exclude/include reqheader directives are right.

Comments

  • I put it in my htaccess file. Vanilla works. Should I look for errors in a log somewhere?
  • Are you using apache 1.3?

    You have check if the css and js files are compressed (you might have to refresh the page). With the web developer toolbar, you can go "Information > View Document size".

    If they are not, check mod_gzip is loaded by apache 1.3.x (or mod_deflate for apache 2.x).
  • edited September 2007
    is anyone actually still using apache 1.3 ? // edit.. mhh... just checked my server. aparantly I do :D
  • eg:
    - with mod_deflate on the home page:
    Scripts (4 files) 10 KB (31 KB uncompressed)
    Style Sheets (2 files) 10 KB (46 KB uncompressed)

    - on the role setting page:
    Scripts (11 files) 42 KB (163 KB uncompressed)
    Style Sheets (2 files) 10 KB (46 KB uncompressed)
  • I'm using apache 2.2.0. I did check the size and it was 341KB. This is my local install. I checked my live forum and it was 281KB (343KB uncompressed) where I did not add this to the htaccess file.
  • edited September 2007
    @jimw: for apache 2, You have to look into your http.conf and check that mod_headers, mod_mime and mod_deflate is enable.

    On xampp, mod_headers and mod_deflate are disable by default. You have to enable them and restart the server. It works on xampp.
This discussion has been closed.