![]() |
Problem with caching - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Problem with caching (/showthread.php?tid=35857) Pages:
1
2
|
Problem with caching - El Forum - 11-13-2010 [eluser]mikekiche[/eluser] Hi, I am new to CodeIgniter. I would like to use the caching capability of codeigniter. i left the config path as default : $config['cache_path'] = ''; then i put in in my controller's function $this->output->cache(1); The first time i access the function, it displays my page, but then, if i want to display it again. If the cache time duration is not over (here 1 mn), it just displays me a blank page... I use codeigniter 2.0 Thanks for you help. Michael Edit : It seems to be a problem from codeigniter 2.0 because i just tried the same thing in codeigniter 1.7.2. and there is no problem. Problem with caching - El Forum - 11-13-2010 [eluser]mikekiche[/eluser] is this normal? is it just me? Problem with caching - El Forum - 11-13-2010 [eluser]dudeami0[/eluser] That doesn't sound to normal. The only thing I can think of is did you check your permissions on the cache folder, but if it works in 1.7.2 that might not be the issue. Problem with caching - El Forum - 11-14-2010 [eluser]mikekiche[/eluser] maybe i am doing something wrong. Where should i put "$this->output->cache(1);" at the beginning or the end (i put it at the end) of my function? Thanks for your help Problem with caching - El Forum - 11-14-2010 [eluser]dudeami0[/eluser] Well from my understanding, it doesn't matter. Codeigniter actually "captures" everything in the controller then outputs it later. Try clearing the cache folder (leave index.html for security) and run a "cached" page. Check out the file that's created when caching happens. Problem with caching - El Forum - 11-14-2010 [eluser]mikekiche[/eluser] I get files in my system/cache folder. I deleted them, but once i displayed my page, it creates a new one (which is normal ?!) But do i have to use a function like get_cache or something to display the cache? I looked at the file that has been created. In the code, there is : 1289770390TS---><html>...</html> Problem with caching - El Forum - 11-14-2010 [eluser]dudeami0[/eluser] Yea, that's normal for it to create a new file. It should just load automatically. Also, it only works with views being loaded and not echos/such from the controller itself. Mind showing a controller function that uses the caching? Problem with caching - El Forum - 11-14-2010 [eluser]mikekiche[/eluser] well i just put it in the already made "welcome" controller of the latest codeigniter version on bitbucket. I just add "$this->output->cache(1);" at the end of the index function... Problem with caching - El Forum - 11-14-2010 [eluser]dudeami0[/eluser] Oh, well that shouldn't happen then :S Make sure no files are corrupted? It works fine on my CI2, but it looks like some changes have been made since my last time downloading it. CodeIgniter 2 isn't "done", so it could just be a bug :p Problem with caching - El Forum - 11-14-2010 [eluser]mikekiche[/eluser] ok. Guess i'll wait... Thanks for your help anyway |