Skip to content

Instantly share code, notes, and snippets.

@qkreltms
Created October 21, 2020 01:12
Show Gist options
  • Select an option

  • Save qkreltms/29af1ea5c1c00c2e27386a03faff7aff to your computer and use it in GitHub Desktop.

Select an option

Save qkreltms/29af1ea5c1c00c2e27386a03faff7aff to your computer and use it in GitHub Desktop.
캐시
참고: https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching?hl=ko
1. CDN에서는 어떤 데이터를 캐시하는가?
api의 content-type에 따라서 (image, pdf, js, css, html 등등...)
주의: CDN이 데이터를 캐시하기 때문에 원하는 때에 최신화된 데이터가 오지 않올 수 있으므로 주의가 필요하다.
2. 어떻게 해야 캐시 데이터를 지정할 수 있는가?
HTTP 해더 설정 (ETag, Cache-Control)
참고: https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9
2.1.ETag HTTP 헤더
stale-while-revalidate 정책
일정 시간 지난 후 => 리소스 변경 체크 => 변경되지 않을 경우 다운로드 건너 띄고 캐시된 데이터 사용(리소스 변경 확인은 어떻게 하는지??(파일 이름))
3. Google amp
amp에서 제공되는 컴포넌트를 사용하면 그 컴포넌트는 구글에 캐시된 컴포넌트를 사용해 속도가 빨라진다 (??)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment