处理查询字符串参数时的 Codeigniter 缓存问题

wan*_*erd 5 php caching codeigniter

问候,

我正在编写一个 CI Web 应用程序,它实现标准文件缓存功能,如下所示:

$this->output->cache(n);
Run Code Online (Sandbox Code Playgroud)

我正在使用段和查询字符串参数的组合,因此似乎遇到了问题。我在用例和输出类代码中看到的是,缓存仅基于段。因此,http://www.example.com/segment/?q=foohttp://www.example.com/segment/?q=bar被视为相同的请求。

有没有人对如何编辑 url_helper、输出类或 CI 基类有任何见解或建议,以便上面的示例将example.com/segment/?q=fooexample.com/segment/?q=bar视为单独的、唯一的请求并将响应单独存储在单独的文件中?

Nov*_*ovo -1

如果 _GET 的值为空,则应该缓存

if(!$_GET)
    $this->output->cache(0);
Run Code Online (Sandbox Code Playgroud)