![]() |
is the ci cache system retard ? - 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: is the ci cache system retard ? (/showthread.php?tid=24799) |
is the ci cache system retard ? - El Forum - 11-20-2009 [eluser]hikari[/eluser] Hello guys I hope you can give me an advise concerning the cache. Here is the situation. I have setup the cache for some controller to about 1 month. after 5 days I checked the cache folder and I discovered >7000 files for a total of 50mb. It is a new website that I recently made for a client so not a lot of visits ~40 a day and there is not a lot of pages 50pages max including the translated version. Is the cache rewriting a new page on every visit or what ?? 7000 files should slow down the system when ci wants to access a cached file. I know that there is no automatically deletion of the old cache which I find stupid. Is creating a cron job and wasting my cpu time my only option? have I missed something? I would really appreciate your comment thanks in advance. is the ci cache system retard ? - El Forum - 11-20-2009 [eluser]Phil Sturgeon[/eluser] What have you entered for the config? Pastie? A cron-job to purge old cache files is ofc a good idea, but you should not be getting that many files in the first place. is the ci cache system retard ? - El Forum - 11-20-2009 [eluser]hikari[/eluser] thanks for your answer. I have for example $this->output->cache(42000); I output the cache at the end of the function after rendering the view maybe I should place it somewhere else ? what do you mean by the config? is the ci cache system retard ? - El Forum - 11-20-2009 [eluser]Phil Sturgeon[/eluser] Sorry dude I keep forgetting cache is not in config. It shouldn't make a difference, but try putting it higher up in the page load before load->view(). is the ci cache system retard ? - El Forum - 11-20-2009 [eluser]Jondolar[/eluser] [quote author="hikari" date="1258731462"]Is the cache rewriting a new page on every visit or what ?? 7000 files should slow down the system when ci wants to access a cached file.[/quote] Having the OS find your page in a directory of 7000 files is much more efficient than having php re-render the page. Do you know how many pages your site will have? Windows will bog down after about 20,000 to 30,000 files in a directory unless you build your disk with special parameters related to the master file table (MFT). Under unix, you probably won't see issues until you hit around 200,000 from what I've read. If your site has been indexed by google several times, then you've probably hit your limit of files. You can look at your logs to see when google has visited and then look at the date of your cache files to determine if the files are being recreated every time. is the ci cache system retard ? - El Forum - 11-23-2009 [eluser]hikari[/eluser] Thank you guys I have tried a little bit of everything and I think now I found the source of the problem. Google bot was responsible for the number of cached files. not ci cache I'm relieved. btw what happend to the expired cached files ? are they overwritten by new files or I still have to delete them ? |