Daily Reflections (2020/02/19)

Topic Overview

  • What are the advantages and disadvantages of Ajax and Flash are
  • Cited CSS optimization to improve performance
  • Write a function obtained N factorial
  • Understanding of the http, https's

Subject to answer

What are the advantages and disadvantages of Ajax and Flash are

  • Ajax:
    • Advantages: searchability; openness; cost; ease of use; ease of development
    • Disadvantages: possible damage to your browser's back function; using dynamic page updates make it difficult for users to save a particular state to the favorites, but these solutions are related
  • Flash
    • Advantages: multimedia processing; compatibility; vector graphics; client resource scheduling
    • Disadvantages: binary format; proprietary format; flash files are often very large, when first-time users need to endure long waiting times; performance issues

Cited CSS optimization to improve performance

  • Load performance
    • CSS compression
    • By way of link load, rather than @import
    • In fact, write separate property complex, higher efficiency, because CSS is ultimately going to resolve such margin-left: left;
  • Select Performance
    • Minimize the use of nested, can be used BEM way to resolve naming conflicts
    • As little as possible even without using the tag selector, this performance is really poor, as well as the same selector *
    • The use of inheritance, to reduce the amount of code
  • Rendering performance
    • Caution high performance properties: Floating positioning
    • Minimize page rearrangement, redraw
    • css Sprite map
    • Custom web fonts, minimize the use of
    • Minimize the use of expensive property, such as box-shadow / border-radius / filter / transparency /: nth-child, etc.
    • Is transformed using transform not cause wide Higher properties redraw
    • Attribute value is 0, the unit without
    • Normalize different browsers prefix: prefix with browser front. After the standard attributes
  • Maintainability, robustness
    • The style has the same attributes pulled out, integration and use in the page by class, improve maintainability css
    • By defining reusable, semantic classes good foundation, and then added to the html, which is a method used in many ui frameworks, such as: class = "btn btn-active btn-blue";
    • Separate from the content and style: css code defined outside the css
    • Container and style separation

Write a function obtained N factorial

function factorial(n) {
      if (n > 1)  return n*factorial(n-1);
      return 1;
}

Understanding of the http, https's

  • basic concepts

    • HTTP: is the Internet's most widely used network protocol, a client and a server-side request and response standard (TCP), hypertext transfer protocol for transmission from the WWW server to the local browser, it can make browsing It is more efficient, so reducing the network transmission
    • HTTPS: HTTP is safe for the target channel, simply, is a safe version of HTTP, HTTP added SSL layer, HTTPS security infrastructure is SSL, encryption and therefore the details will need to SSL
    • The main role of the HTTPS protocol can be divided into two types: one is to establish a channel of information security, to ensure the security of data transmission; the other is to confirm the authenticity of the site
  • the difference

    • ca https protocol needs to apply for a certificate, generally less free certificates, thus requiring a fee
    • http hypertext transfer protocol, information is transmitted in the clear, https is encrypted with a security ssl transfer protocol
    • http and https use is completely different connections, with the port are not the same, the former is 80, which is 443
    • Http connection is very simple, is stateless; is constructed by the HTTPS protocol SSL + HTTP encrypted transmission protocol, a network authentication protocol, the http protocol security than
  • HTTPS works

    • The client initiates HTTPS requests: https user to enter a URL in your browser, and then connect to the server port 443

    • Configure the server: Using HTTPS protocol server must have a digital certificate, you can make your own, you can also to organize application, the difference is their own certificates issued requires client authentication through before they can continue to access, and use of company trusted application the certificate will not be prompted page.

      This certificate is actually a pair of public and private keys, if not very understanding of public and private keys, can be imagined as a key and a lock, but the whole world only you have the key, you can lock head to someone, you can use this to lock important thing locked up, and then sent to you, because only you have the key, so only you can see by this lock lock things up

    • Transfer certificate: This certificate is actually a public key, but contains a lot of information, such as authority, expiration date, etc. convey Certificate of

    • Client parses the certificate: This part of the work is the client's TLS to complete, will first verify that the public key is valid, such as authority, expiration date, etc., if abnormal, a warning box will pop up, there is a problem prompted the certificate. If the certificate is no problem, then generates a random value, and then encrypted with the certificate of the random value, as if to say above, the random value locked up with locks, so unless there is a key, or do not see is locked content

    • Transmit encrypted information: This section is transmitted random value after the certificate encryption, the purpose is to allow the server to get this random value, after the communication client and server can be encrypted decrypted by the random value of

    • Service segment decryption information: decrypting the private key with the server, the client has been passed over the random value (private key), and then the encrypted symmetric content value, is a so-called symmetric encryption, and a private key information by some algorithms are mixed together, so unless you know the private key, or can not get content, but just the client and server are aware of this private key encryption algorithm sturdy enough so long as the private key is complex enough, enough safety data

    • Traffic encryption information: This information is part of the service period information for the private key encryption, the client may be reduced

    • The client decrypts the information: The information passed over by the service segment generated private key to decrypt the client before, so get the decrypted content, the whole process even if a third party to monitor the data has failed

Guess you like

Origin www.cnblogs.com/EricZLin/p/12333941.html