简体   繁体   English

如何启用 codeigniter 浏览器缓存

[英]how to enable codeigniter browser cache

I want to saved input field data in browser cache using Codeigniter我想使用 Codeigniter 在浏览器缓存中保存输入字段数据

<input type="search" name="location" class="icon glass" placeholder="Enter Your Location" required>

This is my input field when a user inputs something and revisit this page another day this field data will be saved on browsers cache.这是我的输入字段,当用户输入内容并在另一天重新访问此页面时,此字段数据将保存在浏览器缓存中。 how to enable this using Codeigniter I tried with $this->output->cache($n);如何使用 Codeigniter 启用此功能 我尝试使用$this->output->cache($n); But didn't understand with this.但是没看懂这个。 Can anyone please clarify me about Codeigniter caching to saved input field data in the browser cache.谁能澄清一下Codeigniter缓存到浏览器缓存中保存的输入字段数据。

A web cache (or HTTP cache) is an information technology for the temporary storage (caching) of web documents, such as HTML pages and images, to reduce bandwidth usage, server load, and perceived lag . A web cache (or HTTP cache) is an information technology for the temporary storage (caching) of web documents, such as HTML pages and images, to reduce bandwidth usage, server load, and perceived lag . Cache is just a collection of data downloaded to help display a web page.( source )缓存只是下载的数据集合,用于帮助显示 web 页面。( 来源

You can not retrive data from browser cache .您无法从浏览器缓存中检索数据。 What you need to use is cookies or sessions您需要使用的是cookies会话

You can find more about difference between cache and cookies here.您可以在此处找到有关缓存和 cookies 之间区别的更多信息。

You can use Cookie Helper or Session Library to achieve you desired result.您可以使用Cookie HelperSession 库来实现您想要的结果。

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

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