diff options
author | Florian Pritz <bluewind@xinu.at> | 2015-08-10 00:16:55 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2015-08-10 00:16:55 +0200 |
commit | f0dd547bd84b4461cdab8d7d556bdb275bf4864a (patch) | |
tree | 3e334f1c812488af3b4d4ddc638b1b29c19c3972 /application/controllers | |
parent | deb442de494680114fcbafa824689b00b5e2b2e0 (diff) |
Increase thumbnail cache ttl
Also try to clean up when files are deleted since 1 month is a rather
long time. Granted, thumbnails are small, but whatever
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/controllers')
-rw-r--r-- | application/controllers/file.php | 3 |
1 files changed, 2 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); |