显示标签为“web front-end performance”的博文。显示所有博文
显示标签为“web front-end performance”的博文。显示所有博文

2013/03/25

A Chinese famous enterprises then test cattle

Know that Google TE fewer people, because the research and development of early defect prevention and detection do enough, in addition to a variety of tests to build a good foundation, the RD design and code quality high graves and or test execution resources, so without much TE. But later want to add the TE, should be aware of existing quality assurance processes and the ability to model the existence of loopholes in the release part not handle, only to change their view to how much pressure people to change values


Full-width and half-width of the difference between input method

A What is the full-width and half-width?
(1) angle - a character occupies two standard character position.
Kanji characters and provides for the full-width English characters and the national standard GB2312-80 graphic symbols and special characters are full-width characters. The general command of the system do not have the full-width characters, just word processing will use the full-width characters.

(2) half-width - refers to the position occupied by a character of a standard character.
Usually letters of the alphabet, numeric keys, symbol keys are half-width, within a half-width of the display code is a byte. Within the system, these three characters are handled as a basic code, so the user input commands and parameters generally use half-width.

B full-width and half-width of each in what circumstances?
The full-width accounted for two-byte, half-width of one byte.
The half-width full-width punctuation, full-width punctuation accounted for two-byte, half-width of one byte, regardless of the half-width or full-width, Chinese characters, or to account for the two bytes.
Only in the source code of the programmed use of the half-width punctuation (excluding internal data string)
(In fact, this case simply does not exist the concept of full-width of the half-width on a computer that does not support Chinese characters and other languages ​​can only use half punctuate)

For most fonts, full angle looks larger than the half-width, of course this is not the essential difference.

C full-width and half-width of the difference between
The full-width is the width of letters and numbers, such as Chinese characters accounted position word. Half-width ASCII character way to do with the time from the Chinese character input method input alphanumeric characters are half-width.

Appear in the Chinese character input method, input alphanumeric default to half-width, but the punctuation is the default for the whole angle corresponding toolbar button mouse click input method.

D "full" and "half-width":
The whole angle: means in GB2312-80 (information exchange · basic set of Chinese ideograms coded character set ") in a variety of symbols.
Half-width: refers to the various symbols of the ASCII code of the English document.



2013/03/24

Control of the entire page cache and update dynamic pages as static pages




Static pages we all know, WEB server sends back the contents of the file comes with a Last-Modified header information, and static files last modification time stored inside, so that when the next time the browser requests the file will get Last -Modified header information exists with the If-Modified-Since sent to the server, telling the server's local cache last modification time, will first determine the end of the file when the server receives the time information of the If-Modified-Since request modify the time is later than this time, the late update, will retransmission of the contents of the file, along with the latest Last-Modified header information to the client, if the time is equal to or more than this time early, it shows no update cache fully synchronized, it will send back a 304 Not Modified status code, and to stop retransmission file content, and can save unnecessary data transmission.
Above is a static page cache and update the control mechanism, generally all this is by the WEB server directly arranged deal, all without user intervention. Dynamic pages are not so lucky, because of the dynamic page requests are forwarded by the WEB server to a specific page handler to complete their cache and update the strategic issues, and not arranged, so these controls must programmers to complete. Unfortunately, however, the dynamic page handler is unable to automatically handle cache is a whole page-level cache, we can cache a variable in the code so that at the next call, but still a lot of code to be executed, they can as static pages to the client a Last-Modified header information, determine the time and data updated when the next request, in order to decide whether to repeat the process and send data?

From the above analysis it is entirely feasible, but it needs to do special processing script, which is a logic to regulate this update detection, of course, this is not the focus on this. Because the the client to accept last modified time to completely rely on the Last-Modified header information, so dynamic scripting can be sent back to the content is also output a time as a basis to judge, then the next time the client requests the same page (accurately, should with a URL address), Last-Modified header information received will be appended to the If-Modified-Since request over. To a dynamic page here, we can get included with the request last modify time, then the first judgment point in time whether there is a new deal with the data, there is no new data, then, we are on the direct end of the current script, you can save server resources. Of course, before the end of the script, you need to play a 304 status code, because let clients sure to use the cache, must also be dependent on the status code, so just use dynamic script sends back a 304 Not Modified header information can not only saving server script execution resources, but also save the flow can be described as killing two birds with one stone, and the application form is more flexible and more controllable.