在客户端Asp.net缓存下拉数据 [英] Asp.net Cache Dropdown Data on Client

查看:112
本文介绍了在客户端Asp.net缓存下拉数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们想缓存数据在客户端计算机上某些下拉列表,以减少缓慢变化的信息传递。这些数据将在商务应用中的多个页面,以便例如经常使用,也可以用于搜索,创造了销售订单或其他目的5000个客户的客户名单中。
我们都试过与页面数据的满负荷以及分页数据库访问和加载哪些带回只有25-50的记录对需求的网格。用户都在抱怨的两个选项的性能,并希望它更快,所以我们正在寻找如何在客户端缓存数据重用选项。

我们已经看到了一些符号,网上有关,也许可以由服务器生成一个JS文件高速缓存和本地缓存是对DDL数据源,但从来没有发现如何做到这一点。

有什么建议?或者其他的选择,你会建议?

请注意:我们需要解决这个到期太像一些列表会改变,每天数次,并应被刷新(而不是一个计时器,但是当他们改变基于响应codeS)<。 / p>

解决方案

在你尝试到的客户的,这是做事情很简单的未predictable方式上启动缓存的东西你有自己的浏览器是如何设置缓存(如果他们有缓存设置为从不?)无法控制的原因,也有很多事情你应该看看。


  1. 你有没有看着缓存的服务器的第一?可以使用的OutputCache和由参数变化它(网格页号,例如),对所有的观察数据集的部分缓存


  2. 到底什么是对用户体验慢?与萤火虫或招潮蟹分析一下,看看有多少请求被每个页面的服务器进行。简单地减少发送的HTTP请求的数量(通过合并和缩小CSS和JavaScript的为例)会做响应时间奇观。


  3. 是什么在你的ViewState?减少被发送的ViewState中来回更快的页面加载的数据量。


  4. 是数据读取服务器上的时间太长程序?优化IT,或许缓存服务器上的数据,所以你不必为经常外出到数据库中。


也许你已经尝试了所有这一切了,但我想我把它扔出去那里,因为依赖于客户端缓存可以是一个令人沮丧的锻炼; Tibial。

We would like to cache data for some dropdown lists on the client machine to reduce the transfer of slow changing info. This data will be used on multiple pages within a business app so for example a customer list of 5,000 customers is frequently used either for searching, creating a sales order, or other purposes. We've tried both full load of the data with the page as well as paged database access and loading the grid on demand which brings back only 25-50 records. Users are complaining about the performance of both options and want it faster so we are looking for options on how to cache the data at the client for reuse.

We've seen some notation that online regarding caching that perhaps a JS file could be generated by the server and cached locally to be the datasource for the ddl but never found how to do this.

Any suggestions? Or other options that you would recommend?

Note: we'll need to address expiry of this too as some of the lists will change a few times per day and should be refreshed (not on a timer but when they change based on response codes).

解决方案

Before you attempt to start caching things on the client, which is an unpredictable way of doing things for the simple reason that you have no control over how their browser is set up to cache (what if they have cache set to "never"?), there are a lot of things you should look at.

  1. Have you looked at caching on the server first? You can use the OutputCache and vary it by parameter (the grid page number, for example) for partial caching of all the viewed datasets.

  2. What exactly is slow about the user experience? Analyze it with firebug or fiddler and see how many requests are being made to the server per page. Simply minimizing the number of HTTP requests being sent (by merging and minifying CSS and javascripts for example) will do wonders for the response time.

  3. What's in your ViewState? Reduce the amount of data being sent back and forth in ViewState for faster page loading.

  4. Is the data fetching routine on the server taking too long? Optimize it, and perhaps cache the data on the server so you don't have to go out to the database as often.

Maybe you've tried all this already, but I thought I'd throw it out there because relying on client-side caching can be a frustrating excercise.

这篇关于在客户端Asp.net缓存下拉数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆