处理查询字符串参数时出现Codeignator缓存问题 [英] Codeigniter caching issue when dealing with query string parameters
问题描述
问候,
我正在编写一个CI网络应用程序,实现标准文件缓存功能:
I'm writing a CI web application which implements the standard file caching functionality as such:
$this->output->cache(n);
我使用段和查询字符串参数的组合,似乎遇到了问题结果。我在我的用例和输出类代码中看到的是缓存只是基于段。因此, http://www.example.com/segment/?q=foo和 http://www.example.com/segment/?q=bar 被视为相同的请求。
I'm using a combination of segments and query string parameters, and appear to be experiencing an issue as a result. What I'm seeing in my use cases and in the Output class code is that the caching is solely segment based. As such, http://www.example.com/segment/?q=foo and http://www.example.com/segment/?q=bar are treated as identical requests.
任何人都有关于如何编辑url_helper,Output类或CI基本类的任何见解或建议,以便上述示例处理 example.com/ segment /?q = foo 和 example.com/segment/?q=bar 作为单独的唯一请求,并将响应单独存储在单独的文件中?
Does anyone have any insight or recommendations regarding how the url_helper, Output class, or CI base class can be edited such that the above example treats example.com/segment/?q=foo and example.com/segment/?q=bar as separate, unique requests and stores the responses in separate files individually?
推荐答案
这可以使用querystring修复codeigniter缓存
带查询字符串的代码信号缓存
this can fix codeigniter cache with querystring codeigniter cache with querystring
它是泰语语言页面,但你可以复制该代码,并将其放在application / core / MY_Output.php:)
it is thai language page but you can just copy that code and put it in application/core/MY_Output.php :)
这篇关于处理查询字符串参数时出现Codeignator缓存问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!