summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
Diffstat (limited to 'application')
-rw-r--r--application/controllers/file.php3
-rw-r--r--application/models/mfile.php1
2 files changed, 3 insertions, 1 deletions
diff --git a/application/controllers/file.php b/application/controllers/file.php
index 85cef5490..868366af0 100644
--- a/application/controllers/file.php
+++ b/application/controllers/file.php
@@ -641,6 +641,7 @@ class File extends MY_Controller {
handle_etag($etag);
$thumb_size = 150;
+ $cache_timeout = 60*60*24*30; # 1 month
$filedata = $this->mfile->get_filedata($id);
if (!$filedata) {
@@ -649,7 +650,7 @@ class File extends MY_Controller {
$cache_key = $filedata['data_id'].'_thumb_'.$thumb_size;
- $thumb = cache_function($cache_key, 100, function() use ($filedata, $thumb_size){
+ $thumb = cache_function($cache_key, $cache_timeout, function() use ($filedata, $thumb_size){
$CI =& get_instance();
$img = new libraries\Image($this->mfile->file($filedata["data_id"]));
$img->makeThumb($thumb_size, $thumb_size);
diff --git a/application/models/mfile.php b/application/models/mfile.php
index 5139a2eee..ea81ee32d 100644
--- a/application/models/mfile.php
+++ b/application/models/mfile.php
@@ -251,6 +251,7 @@ class Mfile extends CI_Model {
rmdir($dir);
}
}
+ delete_cache("${data_id}_thumb_150");
}
public function get_owner($id)