![]() |
Caching and content - 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 and content (/showthread.php?tid=19192) |
Caching and content - El Forum - 05-30-2009 [eluser]innocast[/eluser] Hello, I've just started out developing my site in CI. Since it will be a pretty heavy and well visited site I really need to use caching. The problem is that most of the content of the page can be static and cached, but not all of it. A login box for example should not be cached, and it's a part of every page. If logged in, show AAA, else show BBB. I was thinking about using variables like {memory_usage} and {elapsed_time} to do the dynamic content. But the question is, what kind of code do I create for this? Plugin? Library? A hook? What's the best to do? Thanks for reply, Robert Caching and content - El Forum - 05-31-2009 [eluser]Colin Williams[/eluser] You can't do full page caching in your case. Look into database caching (already provided by CI) and partial caching (scour the Wiki and Forums for that topic; I'm no expert). With partial caching, the areas of your pages that are less dynamic won't require as many, or any, calls to the database. But in turn, you get more file system calls (same is true with database caching). Full page caching is the most efficient, but very limiting on dynamic sites. Also look into server-side options like Memcache, Squid, et al. Just Google it all Caching and content - El Forum - 05-31-2009 [eluser]innocast[/eluser] Hi! Thanks for a fast reply, this is why I love Codeigniter. Anyway, was looking through the wiki and found something called "Sparks" ( http://codeigniter.com/wiki/Sparks/ ). Will give it a try and probably modify it a bit to fit my needs! Thanks, Robert Caching and content - El Forum - 05-31-2009 [eluser]innocast[/eluser] OK, Sparks was an epic failure :-) Will develop my own addon for CI and publish it here when I'm done! Caching and content - El Forum - 05-31-2009 [eluser]Dam1an[/eluser] [quote author="innocast" date="1243771762"]OK, Sparks was an epic failure :-)[/quote] When you say Spaks was an epic failure, is that just in your case, or the library just doesn't work? Caching is something I may need to look into soon'ish and it's a little more more complex then standard dynamic caching in my case ![]() Caching and content - El Forum - 05-31-2009 [eluser]innocast[/eluser] Hi Dam1an! First of all, the library didnt work when first installed. Second of all, when looking through the code, documentation and comments I realised this wasn't optimized for my solution. I'm builing a social network and it's very important that the code is switft and optimized, no bottle necks can be accepted. The idea is great and probably the code too for a small application. It just didn't meet my requirements ![]() // R [quote author="Dam1an" date="1243779113"][quote author="innocast" date="1243771762"]OK, Sparks was an epic failure :-)[/quote] When you say Spaks was an epic failure, is that just in your case, or the library just doesn't work? Caching is something I may need to look into soon'ish and it's a little more more complex then standard dynamic caching in my case ![]() Caching and content - El Forum - 05-31-2009 [eluser]Jondolar[/eluser] How many cached pages do you expect to have? I'm working on a project that needs a custom cache also. I'm using multiple subdirectories to make finding the correct file more efficient. If you plan on caching files in the millions, you might want to ensure your project supports storing cache files in sub/sub directories. Good luck with your project. Caching and content - El Forum - 05-31-2009 [eluser]innocast[/eluser] Yepp, well aware of that :-) Had a "rapidshare" (legal) site before that was using symlinks. When they reached over 15.000 symlinks (expired after 15 minutes with the help of a cronjob) the IO was slowing the system down brutally. Hopefully this library/hook (or whatever it will be) can be a part of the community! By the way, the variables set in the templates like {memory_usage} and {parsing_time}, how are they set? I guess that would be a pretty easy thing to use for DYNAMIC content. Had a look at Zend Framework yesterday, but it was way to complex to use... Even for my big application. So I will stick with CodeIgniter and support it! Caching and content - El Forum - 06-01-2009 [eluser]madeks[/eluser] Hi, I thought you already have your way to go. Here are some of my experience. I once worked for a company that combine 4 cache methods in there website, memcache, DB cache, html cache, hashing file cache. They use them for a specific purpose and maximize it benefit. For my own sake I just modify the CI cahce to be able to config which controller, action or view I want or don't want to cache. It can help me from 0.3 to 0.02 sec. Hope that help. ![]() Caching and content - El Forum - 06-01-2009 [eluser]innocast[/eluser] He he, well I do :-) But I don't have knowledge on how to fully use CI... Yet :-) |