Skip to content Skip to sidebar Skip to footer

Is There A Javascript Loader Which Can Limit The Number Of Sockets To 1 Or 2

I want to create a networked embedded device with an HTML5/JS one-page AJAX configuration application. My problem is: browsers open too much connections nowadays, in my device the

Solution 1:

The only way to reliably limit the number of connections a browser makes to your server is by only requiring a single connection to load everything in your page. In other words, everything must be inline.

<!DOCTYPE html>
<html><head><title>MCU app</title>
<link rel="shortcut icon" href="data:...">
<style>
    /* css here */
</style>
<script>
   // JS here
</script>
</head>
<body>

</body>
</html>

Of course, watch out for <img> tags.

The other option I'd consider is hosting your HTML/JS/CSS/etc on a regular web server, and making only API calls to the embedded device.

For example, you'd open mycoolembeddedapp.com in your browser. The app could ask for the embedded device's IP address, and then make AJAX calls to that IP using CORS.


Post a Comment for "Is There A Javascript Loader Which Can Limit The Number Of Sockets To 1 Or 2"