Database query caching not working |
[eluser]fchristant[/eluser]
I've done some further research and I think I found the problem, check out this code from CI's DB_driver.php file: Code: // Is query caching enabled? If the query is a "read type" The query binding is done AFTER the cache checking. This seems to me like a bug, right? The cache checking mechanism can only know what cache file to look for when it knows the actual query. The actual query can only be known AFTER binding, not before. As a quick check, I swapped these two blocks, performing cache checking after binding. This does solve the problem, the queries are cached now. However, a slight other problem occurs: connections to MySQL are still being made, although no queries are run: 87 Connect os4w@localhost on 87 Init DB os4w 87 Query SET NAMES 'utf8' COLLATE 'utf8_general_ci' 87 Quit 88 Connect os4w@localhost on 88 Init DB os4w 88 Query SET NAMES 'utf8' COLLATE 'utf8_general_ci' 88 Quit 89 Connect os4w@localhost on 89 Init DB os4w 89 Query SET NAMES 'utf8' COLLATE 'utf8_general_ci' 89 Quit Am I right into thinking this is a serious bug? Any thoughts on how to make sure the MySQL connections are not being opened when a cached result is found? |
Messages In This Thread |
Database query caching not working - by El Forum - 05-21-2009, 05:52 AM
Database query caching not working - by El Forum - 05-21-2009, 06:13 AM
Database query caching not working - by El Forum - 05-21-2009, 06:39 AM
Database query caching not working - by El Forum - 05-21-2009, 06:49 AM
Database query caching not working - by El Forum - 05-21-2009, 07:08 AM
Database query caching not working - by El Forum - 05-21-2009, 11:30 AM
Database query caching not working - by El Forum - 05-21-2009, 11:38 AM
Database query caching not working - by El Forum - 05-21-2009, 12:29 PM
|