将模型文件缓存在 app\tmp\cache\models\ 中
我设置配置
Cache::config('default', array(
'engine' => 'File',
'duration' => 3600000,
'serialize' => false
)
);
为什么模型似乎只在 3 秒内缓存,如果 > 3 秒则重新加载模型。 (因为如果我不缓存,我的应用程序加载> 4秒,如果我在 3秒,则加载> 4秒。我假设加载速度较慢,因为插件中的应用程序模型)
为什么我设置持续时间 3600000 或“+5 分钟”它仍然缓存
并且序列化=> false它仍然序列化(我签入文件)
通常发生的错误是
C:\xampp\htdocs\myapp\app\tmp\cache\models\cake_model_default_poll_votes) [function.fopen]: failed to open stream: Invalid argument [CORE\cake\libs\file.php, line 154]
任何人的帮助我都非常感激>
Cake 会自动缓存模型架构,无论您在其中设置什么Cache::config
对此行为绝对没有影响。在调试模式下(Configure::write('debug', > 0)
)Cake 几乎不断地刷新模型架构,以允许您随时对数据库进行更改,并使这些更改正确反映在应用程序中。
在生产模式下(Configure::write('debug', 0)
)模型缓存很少会被刷新。
顺便说一句,你应该阅读core.php
文档:;-P
/**
* CakePHP Debug Level:
*
* Production Mode:
* 0: No error messages, errors, or warnings shown. Flash messages redirect.
*
* Development Mode:
* 1: Errors and warnings shown, model caches refreshed, flash messages halted.
* 2: As in 1, but also with full debug messages and SQL output.
*
* In production mode, flash messages redirect after a time interval.
* In development mode, you need to click the flash message to continue.
*/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)