WEB


  The Pitfall of WebSocket Disconnections Caused by Browser Power-Saving Mechanisms

PrefaceRecently, while using WebSocket (WS) connections, we encountered frequent disconnection issues, occurring hundreds of times per day for a single user. Although using the auto-reconnect feature of socket.io allowed us to quickly restore connections after disconnections, it did not guarantee that every reconnection would successfully receive WS messages. Therefore, we conducted several investigations and tests.Ultimately, we identified the root cause of the issue: the browser's power-saving mechanism, which inadvertently became the culprit behind the problem.Overview of Browser Power-Savi...

919 0       WEBSOCKET JAVASCRIPT POWER SAVING TROUBLESHOOTING


  The Most Popular Car Color

Is there a most popular color among humans as a group?While the answer to this question depends on the definition of "most popular," there is an objective way to consider it: by looking at what color of cars sells the best.The color that has the highest sales in the car market indicates the public's strong preference for that color. Last week, a U.S. automotive website released the ranking of colors for all new cars sold in the U.S. in 2023.The result showed that shades of gray are the most popular, specifically various mixes of black and white, including four main colors: white, black, gray, ...

1,079 0       POPULAR COLOR INTERNET INDUSTRY GRAY COLOR


  How long does the heuristic cache of the browser actually cache?

Heuristic cacheHeuristic caching is the default behavior of browser caching (i.e., for responses without Cache-Control), which is not simply "not caching", but implicitly caching based on the so-called "heuristic cache". HTTP is designed to cache as much as possible, so even if Cache-Control is not specified, the response will be stored and reused if certain conditions are met. This is called heuristic caching.HTTP/1.1 200 OKContent-Type: text/htmlContent-Length: 1024Date: Tue, 22 Feb 2022 22:22:22 GMTLast-Modified: Tue, 22 Feb 2021 22:22:22 GMTCache durationThe formula for calculating the cac...

2,256 0       WEB DESIGN HEURISTIC CACHE


  The four key figures behind the success of JavaScript - Douglas Crockford

JavaScript's success can be attributed to at least four key figures:Brendan Eich, the creator of JavaScriptDouglas Crockford, the creator of JSLint and JSONJohn Resig, the creator of jQueryRyan Dahl, the creator of Node.js.We are already very familiar with Brendan Eich and the invention process of JavaScript, so let's start with Douglas Crockford, the second in command of JavaScript.AllianceIn the 1990s, Microsoft's dominance overshadowed the whole world.At this time, two challengers emerged, one was the IT giant Sun, and the other was the IT upstart Netscape.Sun believed that Java programs co...

4,190 0       DOUGLAS CROCKFORD JAVASCRIPT HISTORY


  JavaScript's New Features: Exploring the Latest Additions to the Language

As the web continues to evolve, so too does the JavaScript ecosystem. With the release of ECMAScript 2023 (ES2023), JavaScript developers can now leverage a range of new features that promise to improve code quality, readability, and maintainability. In this blog post, we'll dive into some of ES2023's most exciting additions and provide practical examples of how they can be used in your projects.1. Private Fields and Methods in ClassesOne of the most anticipated features in ES2023 is the introduction of private fields and methods in classes. These enable developers to encapsulate internal clas...

1,259 0       JAVASCRIPT ES2023


  Understanding JavaScript closure and where it can be used

ClosureThe official definition of closure is: an expression (usually a function) that has many variables and is bound to an environment that includes those variables.In JavaScript, closure refers to the ability of a function to access the lexical scope in which it was defined, even after the function has been executed and left that scope. This ability is due to the fact that when a function is created, it generates a closure that includes a reference to the definition environment of the current function, allowing the function to continue to access those variables within that environment.Below ...

1,277 0       CLOSURE JAVASCRIPT USAGE


  What is your opinion on WordPress hosting providers?

WordPress is a popular content management system (CMS) used by millions of websites around the world. According to data from W3Techs.com, at least 64.2% of websites that have CMS use WordPress’s system.However, to run a WordPress website, you need a hosting provider that can support it. There are many hosting providers that offer specialized WordPress hosting. For example, they would provide seamless, one-click WordPress migrations, or dedicate a team of experts to address any WordPress-related customer concerns.  The quality and reliability of WordPress hosting providers can v...

644 0       HOSTING PROVIDER WORDPRESS


  Let's talk about JavaScript deep clone

In JavaScript, deep clone means creating a brand new object that includes all nested objects, with all properties being completely independent copies. This is different from shallow copying, which only copies the first-level properties, with nested objects being referenced rather than copied.There are multiple ways to perform deep copying in JavaScript, but the best one to use depends on the specific use case.Can use JSON.parse & JSON.stringify? ❌JSON.parse(JSON.stringify(obj)) is a depth cloning method that uses JSON serialization to create an object. It works for objects that do not co...

3,458 0       JAVASCRIPT DEEP CLONE