Skip to content

[4주차] 7장 - 캐시, 8장 - 통합점: 게이트웨이, 터널, 릴레이 (질문) #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions 7장-캐시/src/minji.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 질문
## max-age=0 과 no-cache 를 이용하는 것의 차이
* 원본 서버에 유효성 검사를 수행하게 만든다는 점에서, 실제 동작 자체는 매우 유사
실제로 대부분의 브라우저에서 동일한 뜻을 가짐([toss tech](https://toss.tech/article/smart-web-service-cache))
* HTTP/1.0에는 no-cache 가 없었기 때문에 max-age=0 을 이용하곤 했었음
* ```Cache-Control: max-age=0, must-revalidate``` == ```Cache-Control: no-cache```([MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control))
max-age=0 은 캐시가 원서버와 연결이 끊겼을 때 stale response 를 발생시킬 수 있음. 따라서 must-revalidate 를 붙여야만 no-cache 와 같아지는 것


## 만약 Cache-Control: only-if-cached 인데 캐시에 사본이 없으면 어떻게 될까?
* 캐시에 사본이 없다면 네트워크 요청을 시도하지 않음
* 요청이 실패했다고 응답하며 일반적으로는 504 Gateway Timeout 상태 코드가 반환됨
* 네트워크 요청을 시도하지 않으므로 오프라인 모드에서 유용하게 쓰일 수 있음
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# 질문
## 게이트웨이 vs 프락시
* 게이트웨이와 프락시는 클라이언트와 서버 사이 중개자 역할을 수행한다는 공통점이 있음
* 프락시는 커넥션을 필터링하지만 게이트웨이는 어떤 필터링도 하지 않음
* 6장에서는 프락시와 게이트웨이의 실질적 차이가 모호하다고 언급했음
* 검색했을 때 가장 많이 나오는 차이점이 게이트웨이는 서로 다른 네트워크 통신에서 서로 다른 프로토콜을 호환 가능하게 한다는 것인데, 프락시도 HTTP, HTTPS 사이 상호 다른 프로토콜로 리다이렉팅이 가능하니 분명한 차이라고 보기 어려움