-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doctrine/cache sunset // find replacement #217
Comments
Option 1: to use symfony cache |
Option 2: |
let's analyse this package too |
this is an example of symfony/cache implementation we should investigate if we use this in dotkernel/dot-cache or directly |
Tested and works just fine |
@bidi47 pelase test in the API if it is working |
solved in dotkernel/api#227 |
why access and modify are 1 true year ahead ? |
Short answerIf there is no default lifetime configured, Symfony Cache touches the cached item it just created and sets its modification time to +1 year in the future. By setting return [
'doctrine' => [
'cache' => [
'filesystem' => [
'class' => FilesystemAdapter::class,
'directory' => getcwd() . '/data/cache',
'namespace' => 'doctrine',
'default_life_time' => 86400,
],
],
],
]; Long answerWhen Doctrine's EntityManager tries to load metadata for an entity, touch($tmp, $expiresAt ?: time() + 31556952); // 1 year in seconds adding 1 year to the cache file's modification time. If someone is interested, I traced the steps to follow the request:
|
In conclusion, we will not add the doctrine configuration key: 'default_life_time' => 86400, |
we are cache-ing the doctrine stuff using the code , in local.php
'orm_default' => [ // it is recommended to disable doctrine cache on development // just comment any type of cache you don't want to be applied on development 'query_cache' => PhpFileCache::class, 'metadata_cache' => PhpFileCache::class, 'result_cache' => PhpFileCache::class,
and we recommend the following cache policy:
https://www.dotkernel.com/how-to/doctrine-cache-in-mezzio-and-dotkernel/
Now, the problem is that the function
PhpFileCache
does not exists anymorewe need to replace it somehow ..
maybe dot-cache ressurected ?
The text was updated successfully, but these errors were encountered: