를 줄입니다. 브라우저는 캐싱을 가능한 한 자동화하려고 여러 가지로 노력하지만, 마법사는 아
닙니다. 정적 자원을 캐시하도록 하기 위해 할 수 있는 일이 많이 있고, 또 그렇게 해야 합니다.
마지막으로, 정적 자원의 크기를 줄여 성능을 올릴 수 있습니다. 일부 테크닉은 크기를 줄여
도 데이터를 잃지 않는 무손실이고, 일부 테크닉은 크기를 줄이면서 정적 자원 품질이 떨어지
는 손실입니다. 무손실 테크닉에는 자바스크립트와
CSS
최소화
minification
,
PNG
이미지 최적화
등이 있습니다. 손실 테크닉은 대표적으로
JPEG
와 비디오의 압축 수준을 올리는 것입니다. 이
장에서는 최소화에 대해 설명합니다.
HTTP
요청을 줄이는 번들링에 대해서도 설명합니다.
NOTE
_
일반적으로
CDN
을 쓸 때는 크로스 소스 자원 공유(
CORS
)에 대해 걱정하지 않아도 됩니다.
HTML
에서 불러오는 외부 자원은
CORS
정책을 적용받지 않습니다.
AJAX
를 통해 불러오는 자원에만
CORS
를 적용하면 됩니다(
15
장 참고).
16.2.
미래에도 안전한 웹사이트
웹사이트를 오픈하면 정적 자원을 반드시 인터넷 어딘가에 올려야 합니다. 동적
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.