Understand difference between Cache-Control: max-age=0 and no-cache

There are some differences between Cache-Control: max-age=0 and no-cache.

1.Cache-Control: max-age=0 does not mean the browser will revalidate the requrest resource.

For example, when the browser requests an image, if the browser sends a http request header: If-Modified-Since, and the server sends a response header:Last-Modified to client. if two times of this image is the same, the browser will not revalidate this image.

2.Cache-Control: no-cache means the browser will revalidate resource per request.

It means the browser will not cache any resource. Like example above. even if the image is not modified in sever, if the Cache-Control: no-cache, the browser will request this image every request.

An simple example is:


This is equivalent to clicking Refresh button on the browser.


This is equivalent to clicking Ctrl+F5.