简体   繁体   English

当我启用Codeigniter缓存时,禁用tank auth。 为什么?

[英]When I enable the Codeigniter cache, the tank auth is disabled. Why?

If I activate the Codeigniter cache in the construct function of start controller (for example). 如果我在启动控制器的构造函数中激活Codeigniter缓存(例如)。 So: 所以:

$this->output->cache(20); //20 minutes

If I do login in the principal page (built with Tank auth library) the complete web application is shown, if when I do logout, I reload the page , the complete web application is shown again. 如果我在主页面(使用Tank auth库构建)登录,则会显示完整的Web应用程序,如果我在注销时重新加载页面,则会再次显示完整的Web应用程序。 Why? 为什么?

Obviously, This doesn't happen if the cache is disabled. 显然,如果禁用缓存,则不会发生这种情况。

如果启用了缓存,您将始终从缓存中获取页面,直到20分钟后

Codeigniter is caching the output of the first request. Codeigniter正在缓存第一个请求的输出。 Any further requests will just return the cached page from the initial request. 任何进一步的请求将只返回初始请求的缓存页面。

As your app requires user state, you can't cache the entire page or all users will see the same thing (regardless of state). 由于您的应用需要用户状态,因此您无法缓存整个页面,或者所有用户都会看到相同的内容(无论状态如何)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM