如何缓存YUI数据源?

发布于 2024-09-03 08:36:25 字数 300 浏览 3 评论 0原文

我正在按照 YUI 站点上的步骤设置带有过滤功能的 YUI DataTable

但是,我使用 JSON 作为数据源 ResponseType。当我输入要过滤的值时,请求将再次发送到服务器。我发现这很浪费,因为第一次就已经检索了所有数据。

有没有办法缓存返回的初始数据,然后仅根据该数据进行过滤,这样就不必发出另一个 AJAX 请求?

I'm setting up a YUI DataTable with filtering by following the steps on the YUI site

However, I am using JSON as the DataSource ResponseType. When I type in a value to filter, the request will be sent to the server again. I find this to be wasteful as all the data has already been retrieved the first time.

Is there a way to cache the initial data returned and then filter only according to that data so another AJAX request does not have to be made?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

莳間冲淡了誓言ζ 2024-09-10 08:36:25

您可以使用 YUI 3 缓存实用程序将数据缓存在 javascript 内存或 HTML5 localstorage 对象中。您可以在 http://developer.yahoo.com/yui/3/cache< 阅读更多相关信息/a>

You can use the YUI 3 cache utility to cache the data in javascript memory or HTML5 localstorage object. You can read more about this at http://developer.yahoo.com/yui/3/cache

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文