|
|
@@ -10,6 +10,23 @@ DirectoryIndex index.php
|
|
|
RewriteRule ^(app|config|data|docs)/ - [F,L]
|
|
|
</IfModule>
|
|
|
|
|
|
+# Cache static assets
|
|
|
+<IfModule mod_expires.c>
|
|
|
+ ExpiresActive On
|
|
|
+
|
|
|
+ # CSS and JavaScript - 1 week
|
|
|
+ ExpiresByType text/css "access plus 1 week"
|
|
|
+ ExpiresByType application/javascript "access plus 1 week"
|
|
|
+ ExpiresByType text/javascript "access plus 1 week"
|
|
|
+
|
|
|
+ # Images - 4 weeks
|
|
|
+ ExpiresByType image/jpeg "access plus 4 weeks"
|
|
|
+ ExpiresByType image/gif "access plus 4 weeks"
|
|
|
+ ExpiresByType image/png "access plus 4 weeks"
|
|
|
+ ExpiresByType image/webp "access plus 4 weeks"
|
|
|
+ ExpiresByType image/svg+xml "access plus 4 weeks"
|
|
|
+</IfModule>
|
|
|
+
|
|
|
# Never serve dotfiles (.htaccess, .git*, …), flat-file data, docs, config
|
|
|
# templates or lock files as plain text — regardless of directory.
|
|
|
<FilesMatch "(^\.ht|^\.git|\.(?:json|md|lock|buf)$|\.sample\.php$)">
|