CodeIgniter Forums
About multiples caches on same file - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6)
+--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forumdisplay.php?fid=17)
+--- Thread: About multiples caches on same file (/showthread.php?tid=78113)



About multiples caches on same file - douglaspr - 12-02-2020

How i can use A multiples times at same php file?
my code is that above, i need use 2 different cache system for same php but different queries, if not i'll need use another .php for the same purpose for use multiples caches.

PHP Code:
public function index()

$data['Inicial'] = "";

if (
$this->input->get('act') == "db")
{
if (
$this->load->database() == True)
{
$this->output->cache(30);

// Routine db
}
}
elseif (
$this->input->get('act') == "db2")
{
if (
$this->load->database() == True)
{
$this->output->cache(30);

// Routine db2
}
}

$this->load->view("Login"$data);




RE: About multiples caches on same file - douglaspr - 12-03-2020

Solved using:

$this->config->set_item('cache_path', 'application/cache/db2/');
$this->output->cache(60);

for every case with a different folder.