max-age의 경우 캐싱할 데이터를 몇 초 동안 fresh한 상태로 인지할 것인지를 지정할 수 있다.
s-maxage의 경우 cdn처럼 shared cache에 대해서 캐싱 기간을 설정해줄 수 있다.
토스에서는 브라우저에서는 캐싱을 하지 않고, CDN에서만 캐싱을 하기 원했기 때문에,
s-maxage=31536000, max-age=0
이런 방식으로 캐싱을 해주었다고 한다.
https://stackoverflow.com/a/15972973
Does it make sense to have max-age and s-maxage in the Cache-Control HTTP header?
Considering that max-age applies to all the caches, and s-maxage only applies to shared caches (proxy and gateway cache).... Does it make sense to use both directives in a non-expirable and public...
stackoverflow.com
https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.3
HTTP/1.1: Header Field Definitions
part of Hypertext Transfer Protocol -- HTTP/1.1 RFC 2616 Fielding, et al. 14 Header Field Definitions This section defines the syntax and semantics of all standard HTTP/1.1 header fields. For entity-header fields, both sender and recipient refer to either
www.w3.org
'컴퓨터공학 기초 > 네트워크' 카테고리의 다른 글
[네트워크] URI와 URL의 차이 (0) | 2022.03.17 |
---|---|
[네트워크] DNS란 무엇인가? (0) | 2022.03.17 |
[네트워크] Port란 무엇인가? port는 아파트에서 '몇동 몇호'와 같다. (0) | 2022.03.16 |
[네트워크] IP의 한계점을 해결하는 TCP / + UDP의 개념 (0) | 2022.03.16 |
[네트워크] IP란 무엇일까? IP의 한계점은 ? 편지의 예로 이해해보자. (0) | 2022.03.16 |