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
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:
I not sure and all the mod_gzip_item_exclude/include reqheader directives are right.
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.
0
This discussion has been closed.
Comments
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).
- 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)
On xampp, mod_headers and mod_deflate are disable by default. You have to enable them and restart the server. It works on xampp.