Word-wrap: break-word! Important; “>

  • What are the common HTTP status codes?
  1. What are the common HTTP headers?
  2. What is a Restful API?
  3. Describe the following HTTP caching mechanisms (important)!

Question 1: What are the common HTTP status codes?

12345

1 Server receives the request, 2 succeeds, 3 redirects 302, 4 client, 5 server

Question 2: What is a Restful API? (Get post path delete)

When answering this question, it is combined with the methods get post patch delete requested

1. Background

Traditional methods, modern methods

2. Restful API design (it is an API design method (already popularized))



3. What are the common headers for HTTP?

1. Request Headers

2. Introduction to Response Headers

3. Introduction to headers related to caching (If you say this, the interviewer will probably ask you about caching!)

Problem 4: Describe the following HTTP caching mechanisms (important)!

1. Introduction to caching

What is a cache? Save resources that need not be recaptured. What resources can be cached? Static resources (JS CSS IMG)

2. HTTP cache strategy (mandatory cache + negotiated cache)

2.1 Forced Cache (Server-side Control)

(Initial request) The client returns a resource + cache-control in seconds

On the second request, check the local Cache first to see if cache-control has expired







If the Cache fails, the resource and cache-control are returned again

2.2 the cache-control value

Max-age Cache validity No-cache does not use the local cache of the front-end and is handled by the back-end. (The back-end also has some processing methods.) No-store Does not use any form of cache

2.3 Cache Negotiation (Server Cache Policy)

The server determines whether the content requested by the client can use the cached content (resource identification).



Resource identification (all taken to the server for comparison)



Which one to use?

Summary of HTTP caching – Overview

conclusion