page cache

Permalink
If you're just a user without programming knowledge, ignore this discussion! It's not finished and not meant to be used by people without the proper php knowledge at this point!

---

I talked to Marc about ways to improve Concrete5's performance and he started this discussion afterwardshttp://www.concrete5.org/community/forums/customizing_c5/reconsider...


I finally created an early version of a page cache addon which you'll find attached to this post.

However, there are a lot of issues with it:

1. I'm having a hard time to find a better even to create the cached file. See this discussionhttp://www.concrete5.org/community/forums/customizing_c5/on_page_up... (I don't want to use a cronjob)

2. Axel made some changes to the dispatcher which would be useful for this addon too (http://www.concrete5.org/community/forums/customizing_c5/reconsider_the_current_caching_functionality/)

3. I check for the static file using on_before_render. Unfortunately a lot of code has been executed once it gets fired. On_start doesn't seem to work for me...

4. Due to 2 & 3 it won't improve performance yet..

5. If you look at models/remocache.php updatePageCache you'll see an array with blocks I consider "static". These can be cached as they don't have any dynamic stuff (like a form block). This list isn't complete!

6. I did some "ab" tests with concurrency set to 5. Without cache I get about 32 requests per second, with cache a bit more than 50... I'm confident that with some additional events and Axels code this could go to 100 requests per seconds and more.

1 Attachment

Remo
 
Remo replied on at Permalink Reply
Remo
okay, on_start works too.. I just had to add some code.

Pro: Faster when a page is cached
Con: If you're site isn't cached, setupAndRun is executed twice

~67 Requests pro second
mgraves10 replied on at Permalink Reply
Hey,
I've been working on a similiar solution and was glad that someone has already done the majority of the work. I've already written some code on the functioning side of it, but yours is better (and I don't have to touch the core :-D).
I also wrote a dashboard portion of it that allows you to admin which blocks are considered cacheable (to deal with new blocks added via packages without having to edit code). I'll adapt it to work specifically for this package and edit the way the $cacheable variable to work with it and submit the result to this thread. I think it'll help make it a little more user customizable.
andrew replied on at Permalink Reply
andrew
BTW - this message is very old. concrete5.4.1 now includes full page caching and block-level caching, including different levels of block caching (complete output caching, output caching for registered users, etc...)
mgraves10 replied on at Permalink Reply
Ah, I see that, haven't updated from 5.4.0.5 yet. Wow, you guys are good! :-) time to upgrade
mgraves10 replied on at Permalink Reply
Oh, and as a matter of vocabulary this concept might be better described as "Render (to) Static" not "Caching" so that we don't begin to mix it up with topics dealing with C5's Cache library, zend_cache, etc.