title: WebSockets Energy Consumption
body: <p>On a mobile device (iPhone/Android), what is the impact on battery consumption by implementing WebSockets vs HTTP?</p>
  
  <p>Suppose I'm building an instant messaging app and have two options:</p>
  
  <ol>
  <li>Rely on Push Notifications to notify the device of a new message, and then fetch that message via a REST API.</li>
  <li>Establish a WebSocket connection when the user launches the app, and maintain that connection while the app is active. The server forwards all messages directly to the device, rather than using Push Notifications.</li>
  </ol>
  
  <p>Someone told me that maintaining a persistent WebSocket connection would be a huge battery hog because it requires the antenna to be constantly active, rather than powering down after each request - but is that really true?</p>
  
  <p><a href="https://stackoverflow.com/a/17262656/4259255">This</a> answer suggests that on iOS, each device maintains a persistent connection with the Push Notification service at all times (similar to WebSockets, I suppose), so doesn't that suggest that the device's antenna is running 24/7 anyway?</p>
  
  <p>The extra overhead of HTTP requests would be pretty insignificant for an instant messaging app, but in an application where a large number of items need to be downloaded constantly, a persistent WebSocket connection would be very useful. Any insight about maintaining long-term WebSocket connections on mobile devices (especially concerning battery consumption) would be extremely helpful!</p>