Skip to content

Instantly share code, notes, and snippets.

@sergejmueller
Created August 10, 2012 18:06
Show Gist options
  • Save sergejmueller/3316234 to your computer and use it in GitHub Desktop.
Save sergejmueller/3316234 to your computer and use it in GitHub Desktop.
Auszug aus einer .htaccess mit Caching-Mechanismen
# CHARSET
AddDefaultCharset utf-8
# DEFLATE
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/css
AddOutputFilterByType DEFLATE application/javascript application/json
AddOutputFilterByType DEFLATE text/xml application/xml
AddOutputFilterByType DEFLATE application/rss+xml application/atom+xml
AddOutputFilterByType DEFLATE application/x-httpd-php
</IfModule>
# CACHE
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 month"
ExpiresByType text/xml "access plus 0 seconds"
ExpiresByType text/html "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType application/json "access plus 0 seconds"
ExpiresByType application/rss+xml "access plus 0 seconds"
</IfModule>
# HEADER
<IfModule mod_headers.c>
Header append Cache-Control "public"
Header append Vary Accept-Encoding
Header unset ETag
</IfModule>
# FILETAG
<IfModule mod_headers.c>
FileETag None
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment