ASP.NET是否继续可靠地处理用户通过JavaScript导航客场即使请求? [英] Does ASP.NET continue reliably processing a request even after a user is navigated away via javascript?

查看:174
本文介绍了ASP.NET是否继续可靠地处理用户通过JavaScript导航客场即使请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

环境:


  • 的Windows Server 2003 - IIS 6.x的

  • ASP.NET 3.5(C#)

  • IE 7,8,9

  • FF(无论最新的10版本)

用户方案:

用户输入针对大型数据集的搜索标准。发起请求后,它们被导航到一个结果页面,在那里他们等待,直到数据被加载,然后可以细化数据

User enters search criteria against large data-set. After initiating the request, they are navigated to a results page, where they wait until the data is loaded and can then refine the data.

技术方案:

用户发送搜索条件(通过Ajax调用)后,来电UI后端服务。后端服务查询事务处理系统(S)和所产生的数据置于一个分贝缓存 - 一个非规范化表,设置进一步细化数据(即排序,筛选)。 UI等待,直到数据进行缓存,然后根据得到通知,该过程完成后,导航到结果页。由此产生的页面,然后进行调用,从非规范化表获取数据。

After user sends search criteria (via ajax call), UI calls back-end service. Back-end service queries transactional system(s) and puts the resulting data into a db "cache" - a denormalized table, set-up for further refining the of the data (i.e. sorting, filtering). UI waits until the data is cached and then upon getting notified that the process is done, navigates to a resulting page. The resulting page then makes a call to get the data from the denormalized table.

问题:

搜索是针对最终不得不来查询的基础上输入的条件很多系统大型查询比较慢(15-25秒)。它是为其他查询(小于4秒)比较快的。

The search is relatively slow (15-25 seconds) for large queries that end up having to query many systems based on the criteria entered. It is relatively fast for other queries ( <4 seconds).

的技术限制:


  1. 我们不能完全重新设计这个搜索/体系研究。有办法许多这里复杂的UI和后端是如何连接在一起。该页面需要执行搜索条件后转(因为不能在计算器上解决制约)。

  1. We can not entirely re-architect this search / results system. There are way to many complexities here between how the UI and the back-end is tied together. The page is required (because of constraints that can not be solved on StackOverflow) to turn after performing the search criteria.

我们也不能要求该组织对数据的非规范化搜索之前,因为数据有,如果用户在其他系统的变化是实时的,即数据有,如果正确地显示他们做一个搜索之后。

We also can not ask the organization to denormalize the data prior to searching because the data has to be real-time, i.e. if a user makes a change in other systems, the data has to show up correctly if they do a search afterwards.

的过程,我想跟进:


  1. 我要骗一点点。我想通过发布在消防忘记模型一个异步的HttpHandler的缓存的要求。

  1. I want to cheat a little. I want to issue the "Cache" request via an async HttpHandler in a fire-forget model.

发出查询后,我想在页面过渡到结果页。

After issuing the query, I want to transition the page to the resulting page.

在过渡页,我想轮询高速缓存表,看是否数据已经被插入到它。

On the transition page, I want to poll the "Cache" table to see if the data has been inserted into it yet.

我想这样做过渡马上究其原因,在于结果页面上本身昂贵的(即使没有获取数据) - 甚至让调用,获取该服务之前还是2秒的加载时间从缓存中的数据。

The reason I want to do this transition right away, is that the resulting page is expensive on itself (even without getting the data) - still 2 seconds of load time before even getting to calling the service that gets the data from the cache.

问:

这会否是通过异步处理程序调用的ASP.NET线程继续可靠,即使我使用JavaScript重定向从页面导航离开处理?

Will the ASP.NET thread that is called via the async handler reliably continue processing even if I navigate away from the page using a javascript redirect?

技术边界2:

是的,我知道...这个搜索过程不健全高效。有什么我可以做关于现在。我试图尽我所能让它表现得更好一点,同时我们将继续研究,我们将如何重新构建它。

Yes, I know... This search process does not sound efficient. There is nothing I can do about that right now. I am trying to do whatever I can to get it to perform a little better while we continue researching how we are going to re-architect it.

如果您的答案是:把它扔掉,并开始了,请不要回答。这是不能接受的。

If your answer is to: "Throw it away and start over", please do not answer. That is not acceptable.

推荐答案

有是用于知道如果长时间运行的进程仍处于连接属性Response.IsClientConnected。这样做的原因属性是一个进程将继续运行,即使客户端断开连接,必须通过物业进行手动检测和手动关闭,如果出现premature断开。这是默认不停止在客户端断开连接一个正在运行的进程。

There is the property Response.IsClientConnected which is used to know if a long running process is still connected. The reason for this property is a processes will continue running even if the client becomes disconnected and must be manually detected via the property and manually shut down if a premature disconnect occurs. It is not by default to discontinue a running process on client disconnect.

引用此属性:的http://msdn.microsoft.com/en-us/library/system.web.htt$p$psponse.isclientconnected.aspx

这篇关于ASP.NET是否继续可靠地处理用户通过JavaScript导航客场即使请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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