`
leonzhx
  • 浏览: 786892 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Zz jqGrid data stored in browser cache?

    博客分类:
  • Web
阅读更多

The original article is in http://stackoverflow.com/questions/3885658/jqgrid-data-stored-in-browser-cache

 

Per default the data loaded from the server (JSON or XML data) will be saved in the browser cache, but not used at the next request. The reason is that per default jqGrid implement the same behavior of ajax requests like cache:false parameter of jQuery.ajax . It means that all requests has an additional parameter nd like nd=1286296925096 which is the timestamp. It makes the URL of all GET requests unique and so the local saved data will not used twice. So if you want that jqGrid not use the data from the local browser cache you need to do nothing .

If you want additionally deny saving the data locally (for example because of security reason or to reduce filling of the local cache with the information which will never used) you can include no-store directive in the HTTP header of the server response.

If you do want to cache the server requests and use the data you should prmNames: { nd:null} jqGrid option . Then the data from the next requests could be get from the local browser cache. If you do this I'll recommend you include in the HTTP header of the server response the Cache-Control directives which force to use the caching behavior which you need. For example I use personally Cache-Control: max-age=0 and use ETag with the hash from the data sent. So all ajax requests will be sent to the server to revalidate the local cache. All the requests will be automatically contain If-None-Match HTTP header with the ETag of the data from the local cache. If the data are not changed the server can answer with the response HTTP/1.1 304 Not Modified having no body instead of HTTP/1.1 200 OK with the body having the data. The response HTTP/1.1 304 Not Modified allows the browser to use the local cache.

UPDATED: I use additionally Cache-Control: private which switch off caching the data on the proxy and declare that the data could be cached, but not shared with another users.

If you want read more about caching control with respect of HTTP headers I'll recommend you to read the following Caching Tutorial .

分享到:
评论

相关推荐

    jqgrid 3.8.1 all in one

    这个"jqGrid 3.8.1 all in one"包提供了一个完整的解决方案,包括jqGrid的源代码、文档和可能的示例。 "jqGrid使用帮助.doc"文档很可能是jqGrid 3.8.1的中文版用户手册,涵盖了如何安装、配置和使用jqGrid的基本...

    jQuery网格插件 jqGrid jQuery Data Grid

    6. **编辑与操作**:提供行内编辑、弹出编辑窗口以及新增、删除记录的功能,通过`editData`、`delData`等参数设置编辑和删除的服务器端URL。 7. **自定义行为**:可以通过事件处理函数(如`beforeSelectRow`、`...

    jqGrid 离线帮助手册

    jqGrid 最新版 3.7.2 离线帮助手册,方便各位查看 Installing jqGrid Before you begin System Requirements Download jqGrid Change Log How to Install How it Works My First Grid Basic Grid Conventions ...

    JqGrid插件+JqGridDemo+JqGrid主题

    JqGrid是一款强大的JavaScript表格插件,用于在Web应用程序中展示和操作数据。它基于jQuery库,提供了丰富的功能,如数据排序、筛选、分页、编辑、添加、删除和保存等,极大地增强了网页中表格的交互性和数据管理...

    jqgrid中文文档API

    jQgrid中文文档API jQgrid是一个功能强大且流行的JavaScript插件,用于创建交互式表格。它基于jQuery库,提供了许多强大的功能,例如排序、过滤、编辑、分页等,使得开发者可以快速创建复杂的表格应用程序。本文将...

    jqGrid demo in JSP Struts2 & Hibernate 新版myeclise for Spring 10.0

    4.这就是jqGrid最简单的演示,没有加入任何其它功能, Good Luck! 有人问到没有spring,由于主要是演示jqGrid和jQuery的AJAX功能,所以没有加上spring框架, 如有需要的请留言. jqGrid 演示最新版: 用到的组件: 1....

    jqGrid4.8.2 jqgrid_demo40

    jquery.jqGrid-4.8.2(jquery表格插件).zip----------jqGrid4.8.2包,官网下载的,原封不动的在这里。 jqgrid_demo40-----可用的-使用方法请查看README文件. jqgrid_3.6.5_API_en.chm------附加放在这里的其它资料...

    jquery.jqgrid最新版

    《jQuery.jqGrid详解——打造高效数据管理界面》 jQuery.jqGrid是一款强大的JavaScript插件,主要用于构建数据密集型Web应用程序,特别是在展示和操作大量结构化数据时。它以其丰富的功能集、高度可定制性和易用性...

    JqGrid中文API文档

    JqGrid是一款强大的JavaScript数据网格组件,用于在Web应用程序中展示和操作数据。它基于jQuery库,提供了丰富的功能,如分页、排序、过滤、编辑和格式化数据。本中文API文档将帮助开发者深入理解并有效利用JqGrid的...

    jqGrid_API中文

    jqGrid是一款功能强大的JavaScript数据网格插件,常用于在网页上展示、操作和管理大量结构化数据。它基于jQuery库,提供了丰富的API和配置选项,使得开发者能够灵活地定制表格的功能和样式。以下是对jqGrid API及其...

    jqGrid4.6完整包

    jqGrid 是一个强大的 jQuery 插件,用于在网页上创建、操作和展示数据。这个"jqGrid4.6完整包"包含了所有你需要的组件来构建功能丰富的、可编辑的表格。以下是关于 jqGrid 4.6 版本的一些关键知识点: 1. **jqGrid ...

    关于jqGrid中查询功能

    在IT领域,jqGrid是一个非常流行的JavaScript库,用于创建数据密集型网格视图。它提供了丰富的功能,包括数据检索、排序、分页以及查询。在本篇中,我们将深入探讨jqGrid中的查询功能,特别是如何根据多个或单个条件...

    jqgrid4.6.rar

    jqGrid 是一个基于 jQuery 的开源网格插件,用于在网页上展示和操作数据。这个压缩包 "jqgrid4.6.rar" 包含了 jqGrid 4.6.0 版本,它是一个稳定且功能丰富的表格展示工具,广泛应用于Web开发中数据管理的场景。以下...

    jqGrid中文文档.doc

    jqGrid 是一个基于 jQuery 的数据网格插件,用于在网页上展示和操作表格化的数据。在开始使用 jqGrid 之前,需要具备基本的 JavaScript 和 jQuery 知识,因为 jqGrid 是构建在 jQuery 库之上的。jQuery 提供了简便的...

    jqGrid demo in Struts2 & Hibernate war file part 1

    Struts2 和 hibernate 演示 jqGrid, 使用Action中的 代码可以容易的把jqGrid 用于servlet或纯jsp. Struts 2.16, jqGrid 3.5b, hibernate 3.2 annotation 由于我的上传权限为20M,而我上传上的包括所有的源代码和支持...

    jqGrid完整实例

    jqGrid是一款功能强大的JavaScript表格插件,用于在Web页面中展示和操作数据。它基于jQuery库,提供了丰富的功能,如数据排序、分页、搜索、编辑等,支持远程及本地数据源,广泛应用于数据密集型应用系统。在这个...

    jqgrid加载本地数据并且分页例子

    jqGrid是一款功能强大的JavaScript表格插件,用于在网页上展示并操作数据,它支持各种操作,包括数据的加载、排序、搜索以及分页等。在这个"jqgrid加载本地数据并且分页例子"中,我们将深入探讨如何利用jqGrid实现从...

    jqgrid序列

    - `postData`:额外的参数,可以用来传递搜索条件或自定义数据。 **4. jqGrid的事件和方法** - 事件:如`loadComplete`(数据加载完成后触发)、`beforeSelectRow`(选择行前触发)等,可以绑定自定义函数进行扩展...

    jqgrid +bootstrap4.0 直接使用

    jqGrid 是一个强大的 jQuery 插件,用于在网页上展示和操作数据,它提供了丰富的功能,包括数据排序、筛选、分页和编辑等。Bootstrap 4.0 是一个流行的前端框架,用于构建响应式和移动优先的网站。将 jqGrid 与 ...

    jqGrid_api中文文档

    根据提供的文件信息,我们可以提取出关于jqGrid的知识点,具体如下: 1. jqGrid基础概念 jqGrid是一个用于Web应用程序的JavaScript表格插件,它遵循典型的B/S(浏览器/服务器)架构。在这种架构中,服务器端负责...

Global site tag (gtag.js) - Google Analytics