Description
Questions? Forum: https://phalcon.io/forum or Discord: https://phalcon.io/discord
Describe the bug
Mvc\Model\Query does not use the modelsCache service lifetime.
In
cphalcon/phalcon/Mvc/Model/Query.zep
Line 289 in 83677f1
/**
* By default use use 3600 seconds (1 hour) as cache lifetime
*/
if !fetch lifetime, cacheOptions["lifetime"] {
let lifetime = 3600;
}
if !fetch cacheService, cacheOptions["service"] {
let cacheService = "modelsCache";
}
let cache = this->container->getShared(cacheService);
lifetime var is never fetch from let cache = this->container->getShared(cacheService);
after that.
So if we do not provide a lifetime with cacheOptions (in addition to key), lifetime is kept to 3600.
I started a conversation about that on discord : https://discord.com/channels/310910488152375297/310910488152375297/1337419685741723730
Some screenshots
And the documentation says : https://docs.phalcon.io/5.8/db-models-cache/#resultsets
Details
- Phalcon version: 5.8.0
- PHP Version: PHP 8.3.12
I can make a simple script to reproduce if needed and maybe provide a fix suggestion after having a better look at the source code
Metadata
Metadata
Assignees
Type
Projects
Status