douli1854 2015-05-21 16:19
浏览 61
已采纳

Zend Framework 2缓存文件系统

I've been using the filesystem adapter for cacheing data.

E.g..

$cache = StorageFactory::factory(array(
    'adapter' => array(
    'name'    => 'filesystem'
    'options' => array('ttl' => 1800, 'cache_dir' => './data/cache'),
  ),
));

But when using the getItem() function AFTER the TTL clocks over it returns false on success etc, which it should... However, I've noticed that the file remains on the system. Is there a way of forcing the use of the cached file?

Scenario being.. My cache is outdated, when it runs some expensive functions they return nothing or it times out.. So I'd like to use the cache instead!

Just wondering if thats possible?

Thanks!

  • 写回答

1条回答 默认 最新

  • dongzhan7253 2015-05-22 12:06
    关注

    Here is a useful link to the official ZF2 documentation for the specific StorageAdapter that you are using (filesystem).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 matlab有关常微分方程的问题求解决
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?
  • ¥100 求三轴之间相互配合画圆以及直线的算法
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考