What is the difference between nginx reverse proxy and nginx web server cache?

  linux, question

Caching settings are made on the proxy and the web server. What is the difference?

Is the browser’s cache stored by the browser itself, or does the server require the browser to store it?

I think caching is done on the agent to get some data directly on the agent without going to the server behind. Reduce the pressure on the rear server
Li Li, but I can’t think of the reason for caching on the server. Or is this cache setting for browser caching?
Ask for some nginx theoretical documents.

Nginx is used on the website instead, usually for load. As far as caching is concerned, the contents of the request target are stored in the storage of the proxy unit, so as to speed up the response speed and reduce the resource overhead of the application unit. For example, multiple clients request the same resource. After the proxy cache hits, only one resource scheduling occurs for the application server.

The cache configuration on the web server is generally used to reduce local IO, and the content of the request target will be stored locally at the client.

For example, the web has set Timespan (max-age = 3153600 or Expires:<UTCDateString > for content expiration. for this header, note that the Expires header is http1.0. if the client supports 1.1, it is only necessary to write Cache-Control: max-age. These can be determined by consulting RFC documents and cooperating with browser manufacturers). If there is no content that has not expired in the next request, the browser will not initiate any request and directly read the local cached data.

After the content expires, the browser will initiate a request. If the web side has set LastModified or Etag, these features will be brought along when requesting for the web server to compare the resources. If the content has not changed, it will tell you 304 status and the browser will still read the cached data.