【问题标题】:How to cache module in CI with HMVC如何使用 HMVC 在 CI 中缓存模块
【发布时间】:2012-12-24 19:07:49
【问题描述】:

CI (2.1.3) & HMVC (5.4)

我有标签云(/application/modules/tags)

此模块在模板中显示为一个块 — Modules::run('tags')

如果我在控制器中使用 $this->output->cache(60),它会缓存所有页面(不是标签云视图)。

如何使用块缓存?

【问题讨论】:

    标签: codeigniter caching codeigniter-2 hmvc


    【解决方案1】:

    使用内置缓存的 Codeigniters 无法做到这一点,它只允许您缓存整个页面。你需要去获取自己的 phil sturgeons 部分缓存库。 https://github.com/philsturgeon/codeigniter-cache,这将让你缓存任何你想要的东西。

    唯一的缺点是,如果您不小心,随着网站的发展,维护起来可能会有些麻烦,因此请仔细考虑何时需要清除各种缓存。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-08-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多