Mobile Optimzations for XMPP Servers
With XMPP being available on mobile devices, it stands to reason that clients will have their own ways to reduce battery, network usage, and create a better user experience. Some will ignore presence stanzas while asleep, while others will only deliver certain stanza types while idle. However, optimizations for mobile devices don’t have to be limited to client programs. Servers too can provide logic that helps to improve mobile client usage as well, and Tigase has a few strategies built right in. Let’s take a look at them.
Previously, Tigase implemented custom IQ stanzas, which when sent to the server would change the way the server sends (or does not send) stanzas to the requesting user. This behavior would then be applied to the requesting JID until it was deactivated.
<iq type="set" id="aa1ad"> <mobile xmlns="http://tigase.org/protocol/mobile#v1" enable="true"/> </iq>
This would enable Mobilev1 queuing for the sending server. 3 different algorithms were included with Tigase:
- V1 which would hold all stanzas in a queue
- V2 which would only keep the last presence from each source in queue
- V3 which would do the same as V2, but also queue message carbons
These could be enabled or disabled VIA the plugins section of the init.properties file.
Most recently, Tigase has enabled support for XEP-0352 Client State Indication, and is turned on by default. Now these plugins can be activated using a standardized stanza.
By default, the V2 algorithm dictates the server’s behavior, which will only keep the last presence stanza in queue from users. This reduces the number of stanzas sent to the client when they become active again.
If you want to change the queuing algorithm, this is now set by configuring sess-man in init.properties.
Mobile v3 plugin currently cannot work with XEP-0352 however, so you are limited to V1 or V2.
However implemented, these strategies can drastically reduce the amount of traffic sent to idle devices, enabling mobile clients to still be connected in real-time without an undue drain on battery and bandwidth resources.
For more details on settings see Administration Guide