What causes iOS Safari to constantly reload a foreground page? - mobile-safari

I keep getting reports from users on Safari that my webpage is automatically reloading itself about once per minute, while they're using the page.
My page doesn't do any history state modification, it doesn't use location.reload(), and it doesn't use a crazy amount of memory.
I know Safari might unload background tabs when it runs low on memory. What else can I do to troubleshoot why a browser reloads my page?
Is there anything in the beforeunload event that could help me identify the "source" of these reloads? Or is there some sort of response from an asynchronous fetch() call that would trigger a browser to reload a web page?

Related

Is It Possible to stop a server request manually while the request is being processed by the server

I am using asp.net and Ajax functionalities to make requests to server via web services for a search functionality. On click of search button, I am making the screen inactive by displaying a loading image over it. The issue is some searches takes longer time, and the user is forced to wait till the results are fetched. Is there any way the search can be cancelled manually, like a button click while the search is being performed by the server.
Any help or alternates will be appreciated.
One thing you can try is to set timeout on your ajax call, take a look here:asp-net-page-webmethod-ajax-call-request-timed-out
Another thing is to use javascript setTimeOut to display the user a message after a few seconds saying "its taking too long. wait for results or Abort?" where the "Abort" is a link that refreshes the page.

UpdateProgress not closing when a query takes a long time

I am using the UpdateProgress ASP.NET control along with an UpdatePanel to get some data via a web service, update some content locally and show a spinner whilst doing so.
The problem is that when the web service call takes a long time the spinner won't disapear (as if it fell asleep listening for the async postback response). The content will update locally (I can see the changes in the DB) but the spinner won't go until I refresh the page.
p.s When the data is small, this works perfectly and the spinner stops when the process finishes.
Is there a timeout option I should be setting or something?
EDIT: I am using error handling on the page and spit out any errors encountered in a JS alert box. Also, the method is designed to roll back DB transactions if it encounters an error which doesn't happen.
UpdateProgress timeout is controlled via the AsyncPostBackTimeout on your page's script manager (or master page if script manager is located there). You can set this to zero for no timeout.

Comet/iFrame Streaming Firefox issue

I am testing a comet app using the forever frame technique. The problem I am having in Firefox is that when an update command issued from firefox (using an AJAX post updating a DB which in turn triggers a DB listener to raise an event which prints the script tags to the iframes of listening clients) if there are multiple script prints, only 1 or a few of them gets processed, never all. But I can see that they are all in the iframe.
Chrome and even IE6 do not suffer from this.
But here is the real puzzler: If the update is triggered from another browser, firefox will work, even though it is the exact same content that has been printed out into the iFrame.
So to sum up: if firefox issues the ajax query causing the update, it does not process all of the script tags.
If another browser issues the ajax query, the firefox browser will process all of the tags as it should.
Any ideas?
Hope I was clear enough.
Thanks
I ran into the same issue implementing our comet solution. It apeared that firefox would only execute one script at a time. In the end I went with two iframes, one for the long polling/server push and a second one for commands being sent to the server.

How to hook into the close event of IE

I want to perform some clean-up in my ASP.NET web application when the user closes the IE window or the tab page in which the page is open.
I was looking at the unload event of the "body" element, however the unload event also gets fired when you click the Refresh button in IE or change the URL by typing in the address bar.
Any ideas on which event to catch to trap IE window (6.0 and 7.0) and Tab closing?
use InProc sessions, and the Session_End event in global.ascx to do your cleanup. javascript is too unreliable for this.
Javascript will be unreliable/quite restricting on this for security reasons. It really depends what you are trying to do, if you are trying to fire some code on the clients machine then this is going to be difficult/impossible (which is a good thing, I don't really want websites I don't trust messing with my browser on one of it's most core features, closing a window).
If you want to run some server side scripts to flag the user as gone, again, hard/impossible, as Jasper mentioned global.ascx will go some way as to helping you, but otherwise you will have to have timers and events fired on 'expired' users.

Page does not respond when update panel is in progress, please guide?

In a page I have multiple update panels that have timers associated with them to refresh the grids. My issue is that when asynchronous request (update panel) is in progress page does not respond. If user try to click some other link to move to some other page he even can not do that until asynchronous request is completed.
Is it not possible that user may able to cl...
Browser runs in a single-threaded mode, you can’t run any background task. If any task is running all other event gets queued up and user will get a impact that browser is hanged or not responding, so for situation like this you need to handle this by yourself.
1- Keep the partial post back light and fast.
2- If possible do it in small steps.
3- Show the progress bar, so that client will not get irritated.
Only one UpdatePanel can postback at a time. If your timer is kicking off multiple requests, the last one will win and cancel the rest.
Workaround:
Simultanious Async Requests Using Multiple Update Panel

Resources