The article reflects on the developers take away from recent enhancements of Gmail App on iOS 7 platform (iPhone, iPad). The latest enhancements consist of background app refresh of email thus avoiding users to manually refresh and get new emails. Following is the description of technology behind background refresh feature.
Background App Refresh using Pre-fetching
The new update released for Gmail App for iOS 7 platform makes use of the iOS background app refresh feature. This would mean that iOS users are no longer required to manually refresh the app to get the new emails. Following is the excerpt from Gmail blog post:
“The app now fully supports background app refresh, which means your Gmail messages will be pre-fetched and synced so they’re right there when you open the app”, Melissa Dominguez, a Google software engineer.
Lets try and understand the technology behind this. This is done using what is termed as pre-fetching technique.
When Background App Refresh setting is configured as on, Gmail app refresh themselves in the background. The app retrieves the new emails in the background when it receives a push notification, so that the new email is ready for viewing when one launch the app. At the OS level, iOS learns patterns based on the device usage and tries to predict when an app should be updated in the background. It also learns when the device is typically inactive, such as during the night, to reduce update frequency when the device is not in use. How-much to pre-fetch and when to pre-fetch is key to pre-fetching technique to avoid network bandwidth hogging. Read below to understand more about pre-fetching technique.
What is pre-fetching technology?
Google has been using Pre-fetching technique (described on this page), for sometime now, in various different products such as Picasa, Instant etc. Simply speaking, Pre-fetching technique facilitates the loading of the data ( or file or resources) even before users has asked for it. This technique can primarily be used in the scenarios (requirements) when one can guess/predict users’ next action and the download of the appropriate resources could be started in the background. The same consideration is used by iOS platform to learn the device usage patterns and pre-fetch the content accordingly. Google has been using pre-fetching feature in their photo album tool namely, Picasa.
As a developer, following considerations need to be made before one decides to use pre-fetching technique:
- Analyzing users’ navigation pattern: If users navigation pattern involves accessing the resources one-by-one like that of photo album, pre-fetching could prove to be a great fit.
- Analyzing data to be pre-fetched: Not all data may make a good fit for pre-fetch. For example, if there are resources that are updated frequently, pre-fetch could simply result in stale data. Images do make a good fit for pre-fetch.
- When to start pre-fetch: As the users are browsing the current page, one should avoid pre-fetch before all the resources for current page are downloaded. In other words, one should start pre-fetch after resources for current page are downloaded.
- How much to pre-fetch: One should consider pre-fetch carefully as your application/page could end up hogging all the bandwidth thereby making other webpages load slower.
Why would one consider pre-fetching technique?
Following can be different reasons why one could consider pre-fetching technique:
- Enhanced Usability where user is presented the content in smooth manner while avoiding a manual refresh of the page or so.
- Enhanced Performance in terms loading the page/resources much faster than in normal request-response scenario
- Beta Distribution Explained with Python Examples - September 24, 2020
- Bernoulli Distribution Explained with PythonExamples - September 23, 2020
- K-Nearest Neighbors Explained with Python Examples - September 22, 2020