캐싱은 웹사이트 성능을 꽤 많이 향상시키지만, 부작용도 있습니다. 특히 정적 자원을 수정했
다면 클라이언트는 캐시해둔 버전이 브라우저에서 만료될 때까지 바뀐 내용을 보지 못할 수도
있습니다. 구글은 캐시 기한을 한 달, 가능하면
1
년까지 길게 잡기를 권합니다. 같은 브라우저
에서 매일 웹사이트에 방문하는 사용자가 있다고 상상해보십시오. 이 사람은 업데이트 내용을
1
년 뒤에야 알 수도 있습니다!
당연히 이런 상황을 바라지야 않겠지만 사용자에게 캐시를 지우라고 할 수도 없습니다. 해결책
은 핑거프린트
fingerprinting
입니다. 핑거프린트는 자원 이름에 일종의 버전 정보를 붙이는 방법입
니다. 자원을 업데이트하면서 이름을 바꾸면 브라우저는 바뀐 걸 알고 내려받습니다.
로고(
/
img
/
meadowlark
_
logo
.
png
)를 예로 들어봅시다. 성능을 최대로 올리기 위해 로고를
CDN
에 저장하고 만료 기한을
1
년으로 정하면 사용자는 로고가 업데이트된 걸
1
년 동안 모를
수도 있습니다. 하지만 로고 이름을
/
img
/
meadowlark
_
logo
-
1
.
png
로 바꾸고
HTML
도 그 이
름으로 수정하면 브라우저는 새 자원을 내려받습니다.
사이트에 이미지가 수십 개
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.
O’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
I wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
I’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
I'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.