3) If you want instant access and PUSH something to a "web client"(your device is a web client to any server it connects to) you can use websocket. They're fast and easy: https://www.espruino.com/ws
Just a heads up: in javascript we don't wait for things. (like pausing until the wifi connects or until a website is downloaded) You CAN use promises but you'll see that most of the code uses just a callback (that's just fancy talk for a function as the last parameterthat runs ONLY once something in the call has finished.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hopefully I can help in some of the questions or incorrect assumptions:
1) The ESP8266 does SSL just fine like the ESP32 does. Proof: http://forum.espruino.com/conversations/330049/#comment14873565
2) The amazing Gordo has a write up on doing MQTT if this is what you're looking for: https://www.espruino.com/MQTT
3) If you want instant access and PUSH something to a "web client"(your device is a web client to any server it connects to) you can use websocket. They're fast and easy: https://www.espruino.com/ws
4) If you want an example of code that will "wait until it connects to wifi successfully and then hit a website" here's my code that does exactly that. http://forum.espruino.com/conversations/330049/#comment14873565
Just a heads up: in javascript we don't wait for things. (like pausing until the wifi connects or until a website is downloaded) You CAN use promises but you'll see that most of the code uses just a callback (that's just fancy talk for a function as the last parameterthat runs ONLY once something in the call has finished.
Good luck. this sounds like a great project.