如果有条件 header returns 304,max-age 会自动更新吗?

Does max-age update automatically if a conditional header returns 304?

想象一个 max-age 为 60 秒的资源:

此响应会自动向 max-age 添加新的 60 秒吗?或者这是服务器需要明确处理的情况。

在 HTTP 缓存规范的 section 4.2 中,它表示如下:

A response's age is the time that has passed since it was generated by, or successfully validated with, the origin server.

max-age 指令告诉客户端的 HTTP 缓存响应在 60 秒内有效。因此,一旦服务器发送 304 响应,该缓存响应将在另外 60 秒内有效。

这里的服务器没有什么需要处理的。在收到 304 响应时更新响应取决于客户端的缓存实现。