I'm getting some offers by emails. And there is a competition who get it first.
They send an email with a verification code inside.
Which solution is best to check for new gmail messages and get new message body ASAP?
I heard about
- IMAP IDLE.. is that quick enough?
- POP3 is it better to check for new messages via POP3 continuously?
The fastest method would be IMAP
clearly
it allows a client to indicate to the server that it is ready to
accept real-time notifications.
The basic network use of the IDLE command is very small, and so it
makes very efficient use of bandwidth
A good IMAP server will have minimal overhead for an Idle connection, and it support 10’s or 100’s of thousands of connections.
Another practical problem is that current phone networking technology will lose IP network connectivity from time to time, and this will need to be automatically re-established, and the
IMAP connection re-established if this is lost due to a long network
failure.
If you authentication is open, maybe a simple Web request is fastest of all.
Note, that there is still a large delay between when that email is sent, and in how that email is processed by any number of intermediate servers before it's ultimately in an IMAP/POP account ready for access by the client.
Are you sure you're optimising the correct problem?