We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

SQL query caching in modules

Development and Programming

Adrian Macneil (Crescendo)'s avatar
Adrian Macneil (Crescendo)
28 posts
15 years ago
Adrian Macneil (Crescendo)'s avatar Adrian Macneil (Crescendo)

I am developing an EE module which uses custom sql tables.

Currently, the EE 2.1 setup I am using has sql query caching enabled - I spend a few hours trying to work out why my select queries were giving blatantly wrong results. The current behaviour seems to cache queries indefinitely, so even if I run an update statement then come back 10 minutes later, and run a select, I still get incorrect results.

I don’t want to just disable caching on my local install, because we want to release this module, and other users may have caching enabled, so will run into problems further down the line.

Also, I notice the latest build of 2.1.0 has sql query caching ‘temporarily disabled’.

So my question is: is the behaviour I am seeing actually a bug, i.e. in future versions will the cache be automatically flushed when I call insert/update/delete? OR should I code around that, and always call $this->db->cache_delete() in my models after making an insert/update/delete?

Note: I am using active record syntax wherever possible, if that makes any difference to the behaviour.

Thanks for any help/guidelines 😊

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.