diff --git a/.htaccess b/.htaccess
index ad2bcce53d..ec1b9be77e 100644
--- a/.htaccess
+++ b/.htaccess
@@ -61,3 +61,11 @@ RewriteRule ^([^/.]+)/?$ user.php?$1 [L]
# Deny access
RewriteRule ^(tests|.git) - [F,L,NC]
+
+# Add caching of woff font files to avoid loading 2*15KB each time with Chamilo
+# default OpenSans font
+AddType application/font-woff .woff .woff2
+
+ ExpiresActive On
+ ExpiresByType application/font-woff "access plus 1 month"
+
diff --git a/documentation/installation_guide.html b/documentation/installation_guide.html
index ee044ff075..d92b8fe282 100755
--- a/documentation/installation_guide.html
+++ b/documentation/installation_guide.html
@@ -736,6 +736,12 @@ If you have issues with files taking a long time to download, make sure you reco
RewriteRule ^([^/.]+)/?$ user.php?$1 [L]
RewriteRule ^(tests|.git) - [F,L,NC]
</Directory>
+
+ AddType application/font-woff .woff .woff2
+ <IfModule mod_expires.c>
+ ExpiresActive On
+ ExpiresByType application/font-woff "access plus 1 month"
+ </IfModule>
Nginx
Nginx doesn't support .htaccess rules, so you have no other option than to apply the following rules (note that your PHP backend configuration may vary).
@@ -791,8 +797,8 @@ If you have issues with files taking a long time to download, make sure you reco
}
# Serve static files directly
- location ~* \.(png|jpe?g|gif|ico|js|css|mp3|swf|flv|mp4|ogg)$ {
- expires 1y;
+ location ~* \.(png|jpe?g|gif|ico|js|css|mp3|swf|flv|mp4|ogg|woff|woff2)$ {
+ expires 30d;
access_log off;
rewrite ^/courses/([^/]+)/course-pic85x85.png$ /app/courses/$1/course-pic85x85.png last;
rewrite ^/courses/([^/]+)/course-pic.png$ /app/courses/$1/course-pic.png last;