![]() |
Caching not working! Blank page. How does CI write a cache file? All I see is a timestamp. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Caching not working! Blank page. How does CI write a cache file? All I see is a timestamp. (/showthread.php?tid=6102) |
Caching not working! Blank page. How does CI write a cache file? All I see is a timestamp. - El Forum - 02-14-2008 [eluser]dtrenz[/eluser] Is that what it is supposed to look like? in my cache dir is a file with the following contents: "1203013622TS--->" That's it. Is that right? I'm guessing something is wrong, since the page I am caching is blank after it get's cached. I am placing the cache code as the first line in my controller index() function: Code: $this->output->cache(60); Any help appreciated. I'm pretty new to CI and very new to caching w/ CI. Thanks -d Caching not working! Blank page. How does CI write a cache file? All I see is a timestamp. - El Forum - 02-14-2008 [eluser]nirbhab[/eluser] Have a look over the user guide containing following lines. Warning: Because of the way CodeIgniter stores content for output, caching will only work if you are generating display for your controller with a view. Note: Before the cache files can be written you must set the file permissions on your system/cache folder such that it is writable. i hope you are accessing the controller not the cache file directly. Add your code, so that i could run and solve the problem. Caching not working! Blank page. How does CI write a cache file? All I see is a timestamp. - El Forum - 02-15-2008 [eluser]dtrenz[/eluser] Yes, I read what little documentation there is very carefully. Like I said, I am placing the cache code as the first line in my controller index() function. And when I load a cached page/controller, I get a blank page. Here is a stripped down version of my code (note: this is my default controller): Code: class Home extends Controller Caching not working! Blank page. How does CI write a cache file? All I see is a timestamp. - El Forum - 02-15-2008 [eluser]nirbhab[/eluser] Hi, i ran your script by commenting Code: $this->load->model('home_model'); Caching not working! Blank page. How does CI write a cache file? All I see is a timestamp. - El Forum - 02-15-2008 [eluser]dtrenz[/eluser] well... unless you have my home model file, it won't work. that should be obvious. I have error reporting on and I still only get a blank page. Caching not working! Blank page. How does CI write a cache file? All I see is a timestamp. - El Forum - 02-15-2008 [eluser]dtrenz[/eluser] OK, I just walked the CI Output class and I can't find anywhere that they are writing the actual output of the page to the cache file! All it does is write a timestamp to a file. Where is the actual output? Where is the content and the HTML? I'm so confused. could somebody please explain this to me Code: if ( ! $fp = @fopen($cache_path, 'wb')) Caching not working! Blank page. How does CI write a cache file? All I see is a timestamp. - El Forum - 02-15-2008 [eluser]dtrenz[/eluser] I figured it out! I was using output buffering on all my pages (ob_start() ![]() Does CI support output buffering? Caching not working! Blank page. How does CI write a cache file? All I see is a timestamp. - El Forum - 05-07-2008 [eluser]gzhao[/eluser] I'm running into a similar problem. any more progress on this? Caching not working! Blank page. How does CI write a cache file? All I see is a timestamp. - El Forum - 05-08-2008 [eluser]gzhao[/eluser] i also have the same problem and traced the issue to libraries/Loader.php, in the last part of: function _ci_load($_ci_data) the $OUT->final_output (libraries/Output.php) variable wasn't getting populated. my fix is to take the calls to set the output variable out of the conditional statements. it didn't seem to have broken anything on the test site but more thorough testing is needed. ORIGINAL Code: if (ob_get_level() > $this->_ci_ob_level + 1) FIXED Code: // PHP 4 requires that we use a global |