MDL-32628 lib/filelib.php: Set user profile image expires to 1 year
authorDan Poltawski <dan@moodle.com>
Fri, 4 May 2012 01:36:11 +0000 (09:36 +0800)
committerDan Poltawski <dan@moodle.com>
Fri, 4 May 2012 01:36:11 +0000 (09:36 +0800)
This is to reduce the performance impact of user profile images
requests. Pictures are now referenced by a revision counter so
any changes in picture will not be badly cached any longer.

lib/filelib.php

index 61dac30..aba7175 100644 (file)
@@ -3441,7 +3441,7 @@ function file_pluginfile($relativepath, $forcedownload, $preview = null) {
                 }
             }
 
-            send_stored_file($file, 60*60*24*7, 0, false, array('preview' => $preview)); // enable long caching, there are many images on each page
+            send_stored_file($file, 60*60*24*365, 0, false, array('preview' => $preview)); // enable long caching, there are many images on each page
 
         } else if ($filearea === 'private' and $context->contextlevel == CONTEXT_USER) {
             require_login();