Full Page Cache and Page Statistics?
Permalink
First of all, I'm pretty sure that many (or most) of us site builders give recommendations to our clients that they should use some more sophisticated statistics system than what Concrete5 offers out of the box. However, I'm also pretty sure there are some clients that are quite happy just knowing some rough statistics about site traffic and they might be happy with the default C5 statistics.
I was playing around with system events in C5 and realized that as they won't fire on fully cached pages, the page loads won't be recorded to PageStatistics db table either, because basic statistics rely on on_page_view event. I confirmed this by testing on local site and monitoring the database. I'm aware that C5 core team has stated that the full page cache kicks in very early in the rendering process and events won't fire, but in my opionion it should be _clearly_ mentioned somewhere that the C5 statistics won't give reliable results with full page cache activated.
Please correct me if I'm wrong, as I might be missing something. The topic brings up two problems I'd like to see fixed in upcoming versions of this otherwise awesome CMS:
1) What is the point of an event if you can't be sure if it's fired or not?
2) What is the point of statistics if it won't give accurate and realistic results?
I was playing around with system events in C5 and realized that as they won't fire on fully cached pages, the page loads won't be recorded to PageStatistics db table either, because basic statistics rely on on_page_view event. I confirmed this by testing on local site and monitoring the database. I'm aware that C5 core team has stated that the full page cache kicks in very early in the rendering process and events won't fire, but in my opionion it should be _clearly_ mentioned somewhere that the C5 statistics won't give reliable results with full page cache activated.
Please correct me if I'm wrong, as I might be missing something. The topic brings up two problems I'd like to see fixed in upcoming versions of this otherwise awesome CMS:
1) What is the point of an event if you can't be sure if it's fired or not?
2) What is the point of statistics if it won't give accurate and realistic results?
Maybe the worst point is DB overloading. PageStatistics table is a MyISAM table which can reach millions of records (a page loading adds a new row). MyISAM tables have a table-level locking system. It means that when you are going to add a new record all the table is locked by you and released when the inserting operation has finished. If your site has multiple visits at same time it enqueues operations. It's a very slow operation.
Changing MyISAM to Innodb (a row-level locking system) could speed it up... but the best you can do (IMO) is disabling statistics service. Just add
to the config/site.php