While investigating the issue of a 404 call creating 167 sql queries and thus making concrete cms sites particularly susceptible to botnet attacks [ see Make Page Not Found Page cacheable · Issue #10165 · concretecms/concretecms · GitHub ], it became apparent that our websites are behaving very oddly with regards to the number of sql queries invoked, which is always a lot, and usually more with full page caching enabled than without …go figure!
I was under the impression that if a page is cached, it should only require a handful of queries to identify the target cache-file. But something is very wrong with our sites. All have bespoke themes but switching a site to the Atomic theme and creating a simple new test page makes no noticeable difference to the trends reported below.
Please could someone load up phpdebugbar ( PHP Debug Bar for Concrete CMS :: Concrete CMS Marketplace ) and let me know if the gist of my results are similar to those experienced by others, or if we are misconfiguring our website instances in some way i.e. have we uncovered a global problem, or just made a silly mistake somewhere?
Note that once phpdebugbar is enabled, the new Task Permission of ‘Show Debug Bar’ needs to be set to ‘Guest’ in order to see the tool when logged out.
These are the number of SQL queries invoked after refreshing each page (to allow any secondary server caching mechanisms to kick-in) and being logged out of the admin tools i.e. as a guest user:
WEBSITE 1 (simple demo site hardly ever used)
Home page with a few different blocks:
with page caching disabled: 908
with FPC on if blocks allow: 944
with FPC on in all cases: 944
Very simple page with one block of text:
with page caching disabled: 809
with FPC on if blocks allow: 815
with FPC on in all cases: 815
WEBSITE 2 (dev instance of busy commercial site)
Home page with quite a bit of content:
with page caching disabled: 991
with FPC on if blocks allow: 223
with FPC on in all cases: 1038
Terms & Conditions page with simple text:
with page caching disabled: 819
with FPC on if blocks allow: 176
with FPC on in all cases: 821
Relative variables:
“Concrete\Core\Cache\Level\OverridesCache” => true
“Concrete\Core\Cache\Level\RequestCache” => true
“Doctrine\Common\Cache\ArrayCache” => true
“orm/cache” => true
“orm/cachedAnnotationReader” => true
“Concrete\Core\Cache\Level\ExpensiveCache” => true
EDIT - environment:
Concrete Version
Core Version - 9.4.5
Version Installed - 9.4.5
Database Version - 20250827152432
System User
apache
Database Information
Version: 8.0.43-34.1
SQL Mode: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
Character Set: utf8mb4
Collation: utf8mb4_unicode_ci
Concrete Cache Settings
Block Cache - On
Overrides Cache - On
Full Page Caching - On - In all cases.
Full Page Cache Lifetime - Only when manually removed or the cache is cleared.
Database Entities Settings
Doctrine Development Mode - Off
Server Software
Apache
Server API
fpm-fcgi
PHP Version
8.3.26
PHP Extensions
bcmath, calendar, cgi-fcgi, Core, ctype, curl, date, dom, exif, FFI, fileinfo, filter, ftp, gd, gettext, hash, iconv, igbinary, imagick, imap, intl, json, ldap, libxml, mbstring, mysqli, mysqlnd, openssl, pcre, PDO, pdo_mysql, Phar, posix, random, readline, redis, Reflection, session, shmop, SimpleXML, soap, sockets, sodium, SPL, standard, sysvmsg, sysvsem, sysvshm, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend OPcache, zip, zlib