Skip to content

Commit

Permalink
Introduce node[:apache][:deflate_types] attribute.
Browse files Browse the repository at this point in the history
Move mime-types for which mod_deflate is active into attribute
file. This allows the user to customize these types. In addition this
also aligns NGinx and Apache cookbooks.
  • Loading branch information
jbraeuer committed Jan 3, 2014
1 parent ca37994 commit 1cff05f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions apache2/attributes/apache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@
default[:apache][:keepalive] = 'Off'
default[:apache][:keepaliverequests] = 100
default[:apache][:keepalivetimeout] = 3
default[:apache][:deflate_types] = ['application/javascript',
'application/json',
'application/x-javascript',
'application/xhtml+xml',
'application/xml',
'application/xml+rss',
'text/css',
'text/html',
'text/javascript',
'text/plain',
'text/xml']

# Security
default[:apache][:servertokens] = 'Prod'
Expand Down
2 changes: 1 addition & 1 deletion apache2/templates/default/mods/deflate.conf.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/javascript application/json application/x-javascript application/xhtml+xml application/xml application/xml+rss text/css text/html text/javascript text/plain text/xml
AddOutputFilterByType DEFLATE <%= node[:apache][:deflate_types].join(' ') %>;
</IfModule>

0 comments on commit 1cff05f

Please sign in to comment.