# Serve up .htm files as binary files rather than text/html.
# This allows cyberchef.htm to be downloaded rather than opened in the browser.
AddType application/octet-stream .htm
# Fix Apache bug #45023 where "-gzip" is appended to all ETags, preventing 304 responses
RequestHeader edit "If-None-Match" "^\"(.*)-gzip\"$" "\"$1\""
Header edit "ETag" "^\"(.*[^g][^z][^i][^p])\"$" "\"$1-gzip\""
# Set gzip compression on all resources that support it
SetOutputFilter DEFLATE
# Set Expires headers on various resources
ExpiresActive On
# 10 minutes
ExpiresDefault "access plus 600 seconds"
# 30 days
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
# 7 days
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 604800 seconds"
ExpiresByType application/javascript "access plus 604800 seconds"
ExpiresByType text/html "access plus 604800 seconds"
# Set Cache-Control headers on various resources
Header set Cache-Control "max-age=2592000, public"
Header set Cache-Control "max-age=600, public"
Header set Cache-Control "max-age=600, private, must-revalidate"
Header set Cache-Control "max-age=600, private, must-revalidate"