From: Vincent Zanotti Date: Sun, 8 Nov 2009 02:14:16 +0000 (+0100) Subject: Adds content caching for static content (css, images, javascript). X-Git-Tag: xorg/0.10.2~16 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=f7644ca9771d1a9dd59a761f4e00144eb5e46c5e;p=platal.git Adds content caching for static content (css, images, javascript). Signed-off-by: Vincent Zanotti --- diff --git a/htdocs/.htaccess.in b/htdocs/.htaccess.in index 8d2c3bf..d404569 100644 --- a/htdocs/.htaccess.in +++ b/htdocs/.htaccess.in @@ -2,7 +2,16 @@ RewriteEngine on RewriteBase @REWRITE_BASE@ -# Rewrite URLs of the form 'index.php?q=x': +# Rewrites URLs of the form 'index.php?q=x'. RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ ?n=$1 [L,QSA] + +# Caches the immutable resources for seven days. Generated files (images and JS +# served by PHP) are not affected. +ExpiresActive On +ExpiresByType application/x-javascript "access plus 7 days" +ExpiresByType image/gif "access plus 7 days" +ExpiresByType image/jpeg "access plus 7 days" +ExpiresByType image/png "access plus 7 days" +ExpiresByType text/css "access plus 7 days"