Xi'an Yimatong previously reported: It took two days and two nights to optimize a 1M image to 100kb

Xi'an Yimatong previously reported: It took two days and two nights to optimize a 1M image to 100kb

Xi'an's health code crashed twice in a row, and the incident continued to ferment on the Internet. The relevant responsible persons were suspended, which was considered an explanation to everyone. However, the Yimatong incident is not over yet. Some netizens found that in a report on the Yimatong project in June 2021, there was a suspicion of exaggerating the "technical difficulty".

The report mentioned: "In order to ensure that the system runs more efficiently, they compressed a picture from 1MB to 500KB, and then optimized it from 500KB to 100KB." The report also emphasized the technical difficulty of this matter. The technicians stayed in front of the computer for two days and two nights and finally overcame the "difficulty."

So, is it true that the Xi'an health code crashed twice in a row because of "image compression technology"?

How difficult is image compression technology?

First, you need to determine whether the image can be compressed. Images such as health code images and advertising images can be compressed. The screen size of a mobile phone is limited, and the display effect of a 1MB image is no different from that of a 100KB image.

Image compression is not a difficult technology. Converting png to jpg, modifying the image resolution, etc. can achieve the effect of compressing images. It is impossible to optimize a 1MB image to 100KB in two days and nights. Moreover, in high-frequency usage scenarios, using such a large image itself has defects in product design.

The key to the problem is not the difficulty of compressing images, but whether the technology used to develop the application is up to standard.

In this regard, netizens raised a question: Is the QR code generated on the client?

You should know that the information transmitted by the QR code is a string of characters, which may be a website, product information or a download link. The server only needs to transmit these characters to the client, and then the client generates a QR code image. In this way, the size is at the 1k level, and 100KB is not needed at all.

If the QR code image is generated on the server side and then transmitted to the client, this is a very stupid approach, because it will take up a lot of bandwidth, and when there are too many users, it is easy to crash, and most developers will not adopt this approach. In view of the report of "compressing images for two days and two nights", many insiders have to doubt whether Yimatong will adopt this approach. If so, it is not surprising that it crashed twice in a row.

After capturing the packet of YimaTong, netizens found that this situation did not occur. YimaTong indeed uses the method of generating QR codes at the front end.

Obviously, the picture mentioned in the report that was optimized from 1MB to 100KB was not a QR code, but an image such as an advertisement or logo.

The reason why Yimatong crashed

Netizens discovered some existing problems with Yimatong by capturing packets, such as an 87KB "breaking news" picture that appeared on the homepage, which was just a thumbnail of an article.

If during rush hour, many users open the One-Code Page for the first time and it is not cached locally, the server will inevitably be under tremendous pressure and may easily crash.

In this high-concurrency scenario, such large images should not exist. Another factor may be that the bandwidth of the OneCode is not enough to support the needs of citizens during the peak period of code usage.

It is not important whether the problem is that the technology of One-Code Pass is not up to standard or the bandwidth itself is not enough. What is important is how we should learn from these two lessons and avoid such situations from happening again. After all, during the epidemic, the inability to check the health code will not only affect travel, but also cause many indirect losses.

<<:  One skill a day: You can make a mistake in splicing a URL, and write a crawler

>>:  5G messaging accelerates commercialization and may become the first batch of 5G applications

Recommend

Blockchain, IoT and 5G

5G networks are starting to roll out across the U...

Microsoft drops OneDrive sync support for older versions of macOS

On August 8, Microsoft announced that they will d...

Reconnect the campus network after it is disconnected. Use crawlers to fix it!

[[433698]] Preface Hello, everyone. I am Dasai Ge...

How to choose a managed data center service provider?

When an enterprise chooses a managed data center ...

Omdia: Global 5G subscriptions doubled in the second quarter of 2020

According to the latest report data provided to G...

SD-WAN Today and Tomorrow

[[429002]] Traditional network technology faces e...

Blockchain from an economic perspective

When talking about blockchain, everyone will ment...

Extremely simple operation! IIS site migration can be achieved in 3 minutes

To achieve load balancing or server migration, we...

What the hell are the three-way handshake and the four-way wave?

[[382042]] This article is reprinted from the WeC...