Search code examples
internet-explorernode.jssocket.iocomet

Socket.io: Why is htmlfile preferred to XHR-Polling?


Based on socket.io 0.9.10 default config 1, htmlfile has higher priority over xhr-polling.

I had this idea that xhr-polling (aka long poolling) was a natural choice over websockets when it is not supported. If I keep htmlfile on list, it will be the selected transport for IE6, 7, 8 and 9.

My min req is IE7+, so should I remove htmlfile? I tested xhr-polling on IE7 and 9 and it works fine.

Why is that?


Solution

  • htmlfile streams the data, whereas XHR-Polling is request based, so it's possible for htmlfile to be more efficient. This site has a good explanation of each transport.

    http://showmetheco.de/articles/2011/8/socket-io-for-backend-developers.html