Article Title: One line of JS code loses millions of orders. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Opera found the most expensive Javascript code in history when purchasing servers on a large scale. Due to this line of code, the server vendor successfully dropped the million orders.
Origin:
Some time ago, Opera browser companies needed more and more servers. The company has predicted that Opera Mini, Opera Link, and Opera Turbo will bring about explosive growth. Therefore, it needs to add N servers to reduce the pressure on servers. (In fact, Opera is experiencing explosive growth. see the global mobile Internet Report published every month .)
Since these services are all server-based, the Opera Mini server needs to save traffic acceleration for tens of millions of mobile users around the world, while Opera Turbo is responsible for computer-wide network acceleration, opera Link is frequently synchronized to ensure that thousands of users are updated in real time. Therefore, the number of servers to be added is not an order of magnitude, and the management approves the budget for the entire order to reach several million Kona (currently the price of 1 Norwegian Kona is basically equivalent to 1 RMB ).
After:
The technical controllers of the information system department are familiar. the nature of their work determines that they spend more time on servers than on friends of the opposite sex. After their ups and downs, the company purchased a collection prototype test process. All suppliers send machines to the Norwegian headquarters in Oslo for testing.
Technical Controllers pick servers like girlfriends until one server breaks them all. This server comes from a world-class manufacturer that everyone knows (the name is not mentioned ). After the Opera staff starts, they use the Opera browser to access the management interface and are directly transferred to the error interface. This is not all the problem. when we find the root cause of the problem, together with the CSS inventor (currently Opera CTO), it will cause everyone to crash.
The cause of the error is that a line of code is added to the server management interface by the following dealer. it is determined that the access management interface of the Opera browser directly leads to the incorrect page.
Result:
Thanks to this line of code, the company successfully angered all relevant staff of Opera and successfully lost the million orders. The Opera company was surprised to write code to find our browser and want to sell it to our company's servers?
Culprit:
It is a line of Javascript code, and the logic is simple and crude to process users. it is found that users use the Opera browser to directly turn to the error page. This is the most expensive Javascript code in history.
If (is. opera) {window. location. href = "config/error.htm ";}