Exploring serverless technology by benchmarking AWS Lambda

We benchmark AWS Lambda to validate our assumptions about serverless technology’s performance in the real world.

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




How Javascript detect the network status

In some special case, our developers should know if our request failed because of Network. And if we can do some things when Network reverts the connections.

`naviagtor.onLine` is the best solution for us to know the current status of the Browser Network. And it has been supported by many modern browsers.

navigator.onLine caniuse figures

But in old browser IE8, you should use the `online` event.

Some years ago, many browsers cannot support naviagtor.onLine. So people try to use xhr or image to send a heartbeat to check if Network could get a response.

This could be a good solution when a browser cannot support the API above or the code is running in Node.js.

## navigator.connection

And navigator.connection help us get some basic connection information like speed or other metrics.

😿 But it only works in Chrome.

😀 So let’s see how it work.

Config

A function will be fire when your network could work but in low network bandwidth

A function will be fire when your network could work.

A function will be fire when your network go to offline

API

Check if your network could work.

Start or Stop the network check service.

Add a comment

Related posts:

UI design

The research was mostly done. including researching and analyzing competitors,user survey,demographic,markets research. The user flow of the app has been clear. combined with the research, UI and…

Stripping Down and Building Up Again

Tech Mechanics Digital Creatives has been a pioneer in providing innovative technological business solutions that help build and scale profitable and sustainable enterprises. Founded in 2016, Tech…

The real secret to classroom discipline

Most teachers complain about classroom discipline. If the whole class isn’t impossible, there are always a few students who insist on disrupting the teacher, bothering their classmates, and deviating…