ShuDudu's Home was started in 2011, but the web data is lost, so now begin again, I would like to make some friends, I hope you like ShuDudu's home.
Current position: ShuDudu > Other >

Front and rear ends of several old and new platform compatible and trade-offs

Thursday on May 21st, 2020Other

Last year, the Myshu Blog offline, there is a reason that can continue to maintain too little time, so he moved to microblogging without competition program. Engaged in the work of these ultra-high workload, the results are often not optimistic, but it is difficult to profit in itself, it becomes a non-profit project. Entrepreneurship There is a saying "Well done tired, not right," almost a little bit of work programs, will be doing tired, not to mention the ultra-high workload.

"Well done tired, not of" Another implication is that as a business man, boss, tired of work should find someone else to do, spend money to find someone else to do. So for the very high workload thing, few people willing to do. This is the work of independent developers a great background.

Such logging class, the challenge facing the need to release utilities and (various work dirty work, tired of the job) issues:

1. PHP 5 and PHP 7 compatibility issues.

This issue has been completely resolved. PHP developers directly under 7, 100?ithout the use of PHP 7 special syntax, the use of PHP 7, PHP 5 syntax compatible, so you can, under perfect running PHP 7 platform in PHP 5.

PHP 5 advantages: a more efficient memory, easy to install.

PHP 7 Pros: run faster.

As detailed in the previous test, at the server, PHP 7.4 speed is about PHP 10 ~ 12 times of 5.3; PHP 7.4 speed is about PHP 5.5, PHP 5 to 5.6 times.

Under Debian/Ubuntu, PHP 7.4 speed is about 1.9 ~ 2.1 times 7.3 the PHP's.

PHP 7.0 ~ PHP 7.3, the speed difference is very small.

Although the test results, a large speed difference. But it does not mean that PHP 5 is slow, I still use PHP 5, there are some projects took a few months, it has been changed to PHP 7 syntax, running PHP 7.4.

PHP 5.3, in fact, soon.

2. HTML 5 and HTML 4, HTML compatibility issues.

HTML can support almost all browsers, and support for CSS 3.

There are a lot of HTML 5 browser does not support, but many users HTML 5 is a favorite.

Therefore, the development, while developing two versions 5 HTML, HTML, available for users to download.

(Note: HTML 5 there is a problem that must be true static .css file does not support dynamic pages do not support the pseudo-static .css, so as to develop trouble.

For example, dynamic CSS, you can determine the PC, mobile phone browser in the program file, produce the corresponding CSS code. HTML 5 are written only for PC, mobile phone version 2 static CSS files. )

3. UTF-8, GBK encoding choice.

With the wide application of foreign developers to write at home, UTF-8 encoded in the country's growing use, and even many domestic developers to write programs also use UTF-8 encoding.

In fact, UTF-8 encoding is not currently the world's unified coding, because some plain English operating system if not installed Chinese package, Chinese in UTF-8 encoding is still garbled, for example, the English version of CentOS + Firefox 60.

For the Chinese site, in the future high traffic sites, GBK coding (ANSI coding) can still improve a lot of performance. Chinese a full-width characters, UTF-8 encoding 3 bytes, GBK encoding 2 bytes. How much can improve performance, difficult to estimate, in a high-traffic environment, may not affect the speed, perhaps the N-fold difference. However, the storage volume of database change is very significant.

Because UTF-8 is a favorite of many users, so the standard edition are using UTF-8 encoding.

Development, and launched a GBK encoding, available for users to download. This type GBK encoding, there will be a new name, the user like high-end stuff, the version of the GBK encoding named "Internal Premium." In fact, more high-end coding GBK for Chinese sites, because it can improve the performance of many hosts.

Under what circumstances, non-English sites must use UTF-8 encoding it? Korean site. Because each Korean full-width characters, if in ANSI encoding, will occupy 8 bytes, such as word order # 54620;? This form.

Each Korean full-width characters, occupies 3 bytes in the UTF-8 encoding.

Japanese site coding, the same full-width characters occupy two bytes.

In Japanese UTF-8 encoding, full-size character 3 bytes.

The half-width English characters, whether or ANSI UTF-8 encoding, occupies 1 byte.

Therefore, non-English sites, Korean must use UTF-8 encoding can save a lot of bytes, using Chinese GBK encoding can save a lot of bytes.

GBK encoded version, I in the project, in the HTML code, it disguised as UTF-8 encoding, in order to meet the aesthetic needs of the user. Looks like a UTF-8 encoding, encoding is actually GBK. For example Feedval the Chinese version of the website http://cn.feedval.com

HTML code there is this one:

meta http-equiv = Content-Type content = text/html; charcus = utf-8>

The role of this sentence only for aesthetic, in fact, it did not work. Because the statement is correct charset, here instead charcus.

To set the encoding on the server side:

? Header? ( 'Content-Type: text/html; charset = gbk');>

4. Delete the issue of the return HTML

In the development, a carriage return 2 bytes, so all these years I write HTML code, regarded carriage returns removed, after the fact, in this way will not reduce readability habit. This is because the program, HTML is not used to read, and used relationship before and after the analysis.

Solution to the problem is that a few years ago I wrote in this machine a code analysis tool is closed, very, very easy to use, the future will be released in Eesta platform, with this tool, you can instantly analyze all div>and/div>corresponding to the position than many traditional indentation but also much faster, once the automatic analysis, manual analysis can save at least 5-30 minutes.

At the same time, also any custom labels, these labels analysis start position.

For PHP braces, if Shell fi program and the starting position, the same can instantly analyze it.

For HTML do not like to delete the return of the user, in such a public release version of the program, Standard Edition is not deleted HTML return. The "Internal Premium" is deleted version is more efficient to run back to the line of HTML.

5. Browser compatibility issues

Now is the development in Firefox. In addition, the development of most of the functions are Chrome, test HTML, CSS, JavaScript compatibility Andrews at Safari browser, IE, IOS's. Most currently are compatible, but encountered only a small amount of functionality is not supported in IE.

to sum up:

Most users do not like to focus on how technology. Because technology research, need to do a lot of testing, field development, is a very time-consuming process.

So many users, what's hot, what would.

Many of the latest popular platform, not necessarily the best. Take the HTTPS example, last year I wrote "explain 99.9?f the sites do not need to use https", has hung more than a year. Writing this blog is to appeal to restore the dignity of HTTP. Here done outside the HTTPS response plurality of sets of test stations, HTTPS multiplexed test run points. Test results, HTTP is always faster than HTTPS. In multiplexing, HTTPS and not as fast as legendary, but is a multi-picture Loading, HTTP slightly faster than HTTPS.

If the host computer room using mainland, Hong Kong or Asia, HTTPS basically speed has little effect. But the use of the United States in the daytime host, American host or network peak in the evening, we can get rid of 301 jumps, were tested HTTP, HTTPS, HTTP significantly faster than HTTPS, a lot of stability, and not a gap, twice the total may be slow four or five times more.

Many experienced developers say HTTPS than HTTP occupy more than 40 percent of the CPU resources, I very much appreciate this truth from facts, the courage to explore, not others, and the spirit of nonconformity.

Actual operation, even more than taking up 10?20?f the resources, the flow slightly larger environments, the speed may be slower than 10?20?he proportion of such relationship, this value will always change, is likely to slow several times, also may be lower than 10?rIn short, if it is not related to the financial system, membership system, a blog, most of the sites do not need to use HTTPS. Many people use HTTPS, there is a reason is to prevent backward, go with the flow, appearance, and some people in order to HTTPS and HTTPS.

Of course, there are many users do not want is for someone to intercept data in real-time transmission. However, for the blog page has been generated, some people are sensitive to feeling can be found (separated) (separated) word by the method of search engines.

Most of the corporate site, there is no need to use HTTPS.

Two years ago I shared a Member Login encryption scheme design, this year has been completed in Eesta account in

This program is used before and after the end of the two-way encryption, namely: non-transmitting plaintext before re-encryption server stores non plaintext. Front-end encryption rules, written in JS file, JS file on the server side did hide, not cached browser temporary folder, and can not be read by anyone to download. Even someone with a more specific method to get the JS file, then he needs to be placed ahead of the disease in the user's browser (separated) to monitor drug (separated) data sent by the user to listen to, no 5--10 years it is impossible to restore data, so no one will be free to do it.

Way encryption method such front and rear ends, even without HTTPS, also claim is not transmitted in the clear.

Two or three years, many big foreign sites are forced to use HTTPS, similar to our ICP equipment (separated) case.

For example, we often Let's Encrypt, is directly after installation, and instantly be able to use, does not require any manual review. Therefore, HTTPS does not have the authority. ICP equipment (separated) case, there is no authority, everyone knew it. (No authority) is also similar to the ICP license, just one more qualification, or qualifications, in a sense, decent some of it, or a qualified operator in an industry.

Foreign operations of many mature social programs directly for you to use, operate, with the issue to be shut down, or penalties, just as there is no foreign ICP equipment (separated) case. But how in their country, many companies use HTTPS to restrain it?

When your site, second-level domain (resolves to a different IP secondary domain name) much, one installation, maintenance HTTPS, is a tragedy.

Among them, one of which is equipped with SSL domain name you must have to resolve the current space, and DNS in force, and therefore pan-domain SSL server supports only resolve to the corresponding pan-domain name resolution. If two non-pan-domain name resolution (i.e., each of two different domain names specified IP), a time required to install a domain or SSL to install.

Eesta platform need to develop a version of the summary:

1. PHP 7, PHP 5 compatible;

2. To provide HTML 5, HTML version;

3. Providing UTF-8, GBK (ANSI) version;

4. HTML providing back row, not back version of the row, provides Chaohaoyong code analysis tool is closed once the automatic analysis, manual analysis can save at least 5-30 minutes.

5. Support mobile version, in English.

For UTF-8, GBK (ANSI) version, both technically complete system conversion is complete, but requires some development work, so I do not support the conversion between the two in the early stages of development, can only select one kind .

Copyright Protection: ShuDudu from the original article, reproduced Please keep the link: https://www.shududu.com/other/Front-and-rear-ends-of-several-old-and-new-platform-compatible-and-trade-offs.htm