diff --git a/www-api/app/Controllers/BaseController.php b/www-api/app/Controllers/BaseController.php index a01ce785..b5aff432 100644 --- a/www-api/app/Controllers/BaseController.php +++ b/www-api/app/Controllers/BaseController.php @@ -51,13 +51,13 @@ abstract class BaseController extends Controller // E.g.: $this->session = \Config\Services::session(); } - public function saveCache($cacheKey,$data){ + public function saveCache($cacheKey,$data,$timeLine=5000){ $cacheKey = CACHE_DOMAIN."-".$cacheKey; // $cache = \Config\Services::cache(); if (! $foo = cache($cacheKey)) { // echo 'Saving to the cache!
'; // cache()->save($cacheKey, $this->data_stringify($data), 3000); - cache()->save($cacheKey, serialize($data), 3000); + cache()->save($cacheKey, serialize($data), $timeLine); //serialize } diff --git a/www-api/app/Controllers/WrenchMedia.php b/www-api/app/Controllers/WrenchMedia.php index 1a07dad7..683bde34 100644 --- a/www-api/app/Controllers/WrenchMedia.php +++ b/www-api/app/Controllers/WrenchMedia.php @@ -150,6 +150,15 @@ class WrenchMedia extends BaseController } else { + + + + if (isset($selectedFile) && $selectedFile!=''){ + $endpoint = "SECUREFILE-".$selectedFile; + $this->saveCache($endpoint,$out,10000); + } + + $filename = basename($out["saved_file_name"]); $file_extension = strtolower(substr(strrchr($filename,"."),1)); switch( $file_extension ) {