Saturday, March 22, 2014

Rejoice! Keeping iPhone-based Browser from Re-loading Open Windows Upon Returning from Other Apps

Stumbled on this way to keep Safari and other web browsers on the iPhone from automatically re-loading open browser windows when you switch back into them from another application, typically the launchpad (i.e., where you see all your app icons). Puzzlingly for most people, the behavior is inconsistent; sometimes it happens, other times not. I'll explain why in a paragraph down.

This method works with other iPhone browsers such as the popular Mercury browser since the code this method uses is part of the iOS (the iPhone's operating system), not any particular app. This method also may work for browsers found on iPads, etc. I don't know though since I'm iPad-less.

Before revealing it (torture!), I'll briefly explain why the pages refresh. The iOS is memory-paranoid. As much as possible it yields only the memory it needs to for an app to run. This is because it can't tell either how many apps the user will open or keep open but "backgrounded" when the user switches out from it without quitting out of it. Windows and the Mac OS have the same challenge as does any other OS that allows more than one application (or program) to run at a time. The issue is more significant for the iOS because the iPhone has relatively less memory free to allow applications to claim. Apps like web browsers are notorious memory hogs, so the iOS kabashes their grabs for free memory. The biggest way they do this is to clear the browser's page content stored in memory when the browser app is backgrounded. Disabling "Background auto-refresh" in the system settings for the iPhone doesn't change this behavior. So when the user switches back to the browser, it must re-fetch the open browser windows' content either from file cache, the original source server, or both. Annoying. Anything typed into a text box is lost, sessions are sometimes expired unnecessarily, etc. As mentioned above, the behavior is inconsistent. That's because the memory cache purge done by the iOS happens at its "discretion" based on how well it's currently doing for free memory.

People have been asking Apple about this since Safari was released with the iPhone and to my knowledge they haven't described a way to disable this behavior by way of a general setting or simply added a way to suppress this behavior in the Safari prefs.

The method is simple, but before switching out of Safari (or any other browser app), you must remember to do it. What you do is touch and hold on a piece of text (a single word or letter is fine), then lift your finger off the screen. The word or letter will be selected and the familiar little pop-up that says "Copy | Define" appears. Touch "Define" and the screen that shows the word's definition or says it couldn't find a definition pops up. Now, do *not* touch anything else; not "Done", "Search the Web", or anything else. Now press the Home button (i.e., the one on the bottom portion of the front face panel of the iPhone with the square in it). You will be switched back to the springboard with all your app icons and from there can do anything else you want. Then, touch the browser icon for the browser you were in and you'll switch back into it. The definition screen covering the browser window will still be there. Touch "Done", and the screen drops away. Blessedly, the open browser window(s) will *not* reload.

Remembering to do this may take some time but eventually it'll become habitual, like anything else.

Feel free to share this life-changing tip far and wide. If you must thank me, name a kid or two after me, or my missus, Brenda. After all, girls named "Matthew" don't have an easy time of it in school. =)

-----
Addendum: A couple times when I originally posted this, I referred to 'Safari' as 'Navigator'. Don't know what got into my head. I've corrected those mistakes.

2 Comments:

Anonymous Anonymous said...

Ohmygod! This also works between switching apps other than safari if you can get a dialog box open.

You are a saint, sir.

May 14, 2014 1:40 AM  
Blogger Matt Campbell said...

Glad it helped. "St. Matthew of the iPhone Browser Reload Problem"... LOL!

May 14, 2014 8:25 AM  

Post a Comment

<< Home