Some CMS's or websites don't seem to like all the speed settings we use so we've been putting the following into each virtual host file:# SPEED SETTINGS# -----------------------------------------------------------------------# Expired headers on cached items - file types below will be cachedExpiresActive OnExpiresByType text/html access plus 90 secondsExpiresByType text/css access plus 2 weeksExpiresByType text/javascript access plus 2 weeksExpiresByType image/png access plus 1 month# Which file types to compress (deflate in Apche speak)AddOutputFilterByType DEFLATE text/html text/css text/xml application/x-javascript application/javascript# The downside of mod_deflate is the CPU time consumption so you may have to lower the compression level depending on your server# UNCOMMENT and change number - 9 being the highest compression level, standard is 6# DeflateCompressionLevel 6# Deactivate compression for buggy browsersBrowserMatch ^Mozilla/4 gzip-only-text/htmlBrowserMatch ^Mozilla/4\.0[678] no-gzipBrowserMatch \bMSIE !no-gzip !gzip-only-text/html# Tells proxies not to deliver the same content to all user agents, because some of them just can't handle itHeader append Vary User-Agent# Saves time on every request by turning off - can effect cgi scripts so comment out if having issuesHostnameLookups Off# Persistent connections let the browsers request multiple files with one TCP connection, thus reducing overhead for TCP handshakes and speeding up requests a lotKeepAlive On# The maximum number of requests per one persistent connection - bad spambots may suck up all available connections if number is too highMaxKeepAliveRequests 100# The timeout after which a persistent connection is dropped - if high peaks in traffic are expected, don't set too high as you might have no connections left to serve new incoming requestsKeepAliveTimeout 15But we've been told they should be set globally in the apache config for the server - are there any downsides to controlling the settings host-by-host?
Should speed/cache settings go into the virtual host file or the apache config?
debian;apache httpd;virtual host