ํฐ์คํ ๋ฆฌ ๋ทฐ
๐ CDN(Content Delivery Network)์ด๋?
CDN์ ์ ์ธ๊ณ์ ๋ถ์ฐ๋ ์๋ฒ ๋คํธ์ํฌ๋ก, ์ฌ์ฉ์๊ฐ ์น ์ฝํ ์ธ (์: ์ด๋ฏธ์ง, ๋์์, CSS, JavaScript ํ์ผ ๋ฑ)๋ฅผ ๋ ๋น ๋ฅด๊ฒ ๋ฐ์ ์ ์๋๋ก ํด์ค๋๋ค. CDN์ ์ฌ์ฉํ๋ฉด ์ฌ์ฉ์์ ๊ฐ๊น์ด ์๋ฒ์์ ์ฝํ ์ธ ๋ฅผ ์ ๊ณตํ์ฌ ๋ก๋ฉ ์๋๊ฐ ๋นจ๋ผ์ง๊ณ , ์๋ฒ ๋ถํ๊ฐ ์ค์ด๋๋ ์ฅ์ ์ด ์์ต๋๋ค.
๐ CDN ์ฌ์ฉ ๋ฐฉ๋ฒ
1. CDN ๋งํฌ ๊ฐ์ ธ์ค๊ธฐ
๋ง์ ์คํ ์์ค ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ ํ๋ ์์ํฌ๊ฐ CDN ๋งํฌ๋ฅผ ์ ๊ณตํ๊ณ ์์ต๋๋ค. ์๋ฅผ ๋ค์ด, jQuery, Bootstrap, Font Awesome ๊ฐ์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ ๊ณต์ ์ฌ์ดํธ๋ CDN ์ ๊ณต์ ์ฌ์ดํธ์์ CDN ๋งํฌ๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค.
2. CDN ๋งํฌ HTML ํ์ผ์ ์ถ๊ฐํ๊ธฐ
CDN ๋งํฌ๋ฅผ ๊ฐ์ ธ์๋ค๋ฉด, HTML ํ์ผ์์ <script> ๋๋ <link> ํ๊ทธ์ ํด๋น ๋งํฌ๋ฅผ ์ถ๊ฐํ๋ฉด ๋ฉ๋๋ค. ์ด๋ ๊ฒ ํ๋ฉด, ๋ณ๋์ ํ์ผ์ ๋ค์ด๋ก๋ํ์ฌ ์๋ฒ์ ์ ๋ก๋ํ์ง ์๊ณ ๋ ์ธ๋ถ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค.
์์ : jQuery์ Bootstrap์ CDN์ผ๋ก ๋ถ๋ฌ์ค๊ธฐ
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CDN ์์ </title>
<!-- Bootstrap CSS CDN -->
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<h1 class="text-center">CDN ์์ </h1>
<button id="myButton" class="btn btn-primary">ํด๋ฆญํ์ธ์</button>
</div>
<!-- jQuery CDN -->
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<!-- Bootstrap JS CDN -->
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.bundle.min.js"></script>
<script>
// jQuery๋ฅผ ์ฌ์ฉํด ๋ฒํผ ํด๋ฆญ ์ด๋ฒคํธ ์ถ๊ฐ
$('#myButton').click(function() {
alert('๋ฒํผ์ด ํด๋ฆญ๋์์ต๋๋ค!');
});
</script>
</body>
</html>
์ HTML ์์ ์์ Bootstrap CSS์ jQuery๋ฅผ CDN์ผ๋ก ๋ถ๋ฌ์์ต๋๋ค. ์ด๋ฅผ ํตํด ๋ถํธ์คํธ๋ฉ ์คํ์ผ์ ์ ์ฉํ๊ณ , jQuery๋ฅผ ์ฌ์ฉํด ๋ฒํผ ํด๋ฆญ ์ด๋ฒคํธ๋ฅผ ๊ตฌํํ ์ ์์ต๋๋ค.
3. ์ฃผ์์ฌํญ
- ์ธํฐ๋ท ์ฐ๊ฒฐ ํ์: CDN์ ์ฌ์ฉํ๋ ค๋ฉด ์ธํฐ๋ท ์ฐ๊ฒฐ์ด ํ์ํฉ๋๋ค. ์ธํฐ๋ท์ด ๋๊ธฐ๋ฉด ์ธ๋ถ CDN ๋งํฌ์ ์ฝํ ์ธ ๋ฅผ ๊ฐ์ ธ์ฌ ์ ์์ต๋๋ค.
- ๋ธ๋ผ์ฐ์ ์บ์ ํ์ฉ: CDN์ ๋์ผํ ํ์ผ์ ์ฌ๋ฌ ์น์ฌ์ดํธ์์ ์ ๊ณตํ๊ธฐ ๋๋ฌธ์, ๋ธ๋ผ์ฐ์ ๊ฐ CDN ํ์ผ์ ์บ์(์์ ์ ์ฅ)ํ ์ ์์ต๋๋ค. ์ด๋ก ์ธํด ๋ก๋ฉ ์๋๊ฐ ๋ ๋นจ๋ผ์ง ์ ์์ต๋๋ค.
- ๋ฐฑ์ ํด๋ฐฑ(fallback) ์ค์ : CDN ์๋น์ค๊ฐ ์ผ์์ ์ผ๋ก ๋ฌธ์ ๊ฐ ์๊ธธ ๊ฒฝ์ฐ๋ฅผ ๋๋นํด ๋ก์ปฌ ํ์ผ์ ๋ฐฑ์ ์ผ๋ก ์ค์ ํ ์ ์์ต๋๋ค. ์๋ฅผ ๋ค์ด, jQuery๋ฅผ ๋ก์ปฌ์์ ์ ๊ณตํ ์ ์๋๋ก ์๋์ ๊ฐ์ด ํด๋ฐฑ์ ์ค์ ํ ์ ์์ต๋๋ค.
<!-- jQuery CDN -->
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<!-- ํด๋ฐฑ: CDN ์คํจ ์ ๋ก์ปฌ ํ์ผ ์ฌ์ฉ -->
<script>
if (typeof jQuery == 'undefined') {
document.write('<script src="/path/to/your/local/jquery.min.js"><\/script>');
}
</script>
4. ์์ฃผ ์ฌ์ฉํ๋ CDN ์ ๊ณต ์ฌ์ดํธ
- jsDelivr: https://www.jsdelivr.com/
- CDNJS: https://cdnjs.com/
- Google Hosted Libraries: https://developers.google.com/speed/libraries
- Microsoft Ajax CDN: https://www.asp.net/ajax/cdn
์ด ์ฌ์ดํธ๋ค์์ ๋ค์ํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ์ต์ ๋ฒ์ ๊ณผ CDN ๋งํฌ๋ฅผ ์ฝ๊ฒ ์ฐพ์ ์ ์์ต๋๋ค.
๐ฏ CDN ์ฌ์ฉ์ ์ฅ์ ์์ฝ
- ์๋ ํฅ์: ์ฌ์ฉ์์ ๊ฐ๊น์ด ์๋ฒ์์ ์ฝํ ์ธ ๋ฅผ ์ ๊ณตํด ๋ก๋ฉ ์๊ฐ์ ์ค์ฌ์ค๋๋ค.
- ์๋ฒ ๋ถํ ๊ฐ์: ๋ฉ์ธ ์๋ฒ ๋์ ์ฌ๋ฌ ์๋ฒ์ ์ฝํ ์ธ ๊ฐ ๋ถ์ฐ๋๋ฏ๋ก, ํธ๋ํฝ ๋ถํ๋ฅผ ์ค์ผ ์ ์์ต๋๋ค.
- ์๋ ์ ๋ฐ์ดํธ: ๋ผ์ด๋ธ๋ฌ๋ฆฌ๊ฐ ์ ๋ฐ์ดํธ๋๋ฉด CDN์ ํตํด ์ต์ ๋ฒ์ ์ ์ฝ๊ฒ ์ฌ์ฉํ ์ ์์ต๋๋ค.
- ๋ธ๋ผ์ฐ์ ์บ์ ํ์ฉ: ๋ง์ ์น์ฌ์ดํธ๊ฐ ๊ฐ์ CDN URL์ ์ฌ์ฉํ๋ฏ๋ก, ๋ธ๋ผ์ฐ์ ์บ์๊ฐ ์ ์ฉ๋์ด ๋์ฑ ๋น ๋ฅธ ๋ก๋ฉ์ด ๊ฐ๋ฅํฉ๋๋ค.
CDN์ ๋น ๋ฅด๊ณ ํจ์จ์ ์ธ ์น์ฌ์ดํธ๋ฅผ ๊ตฌ์ถํ๋ ๋ฐ ์ค์ํ ์ญํ ์ ํ๋ฉฐ, ํนํ ์ฑ๋ฅ์ด ์ค์ํ ๋๊ท๋ชจ ์๋น์ค์์ ์์ฃผ ์ฌ์ฉ๋ฉ๋๋ค.
- Total
- Today
- Yesterday
- ajax (asynchronous javascript and xml)
- structuredclone()
- chrome extension ์๋ ๋ฐฐํฌ
- inp
- Collections
- semver)
- pwa(progressive web app)
- react router
- mermaid-cli
- styled-components
- react
- ์ฝ๊ฒ ํ์ด์ด C์ธ์ด Express
- javascript ํ์ ๋ฌธ๋ฒ
- defaultdict
- ์ค์ฒฉ ํจ์(nested function)
- core web vitals
- named export vs default export
- jackson ๋ผ์ด๋ธ๋ฌ๋ฆฌ
- json.parse(json.stringify())
- x.y.z (๋ฉ์ด์ .๋ง์ด๋.ํจ์น)
- ํ๋ก์ธ์ค ๊ฐ์ ์ข ๋ฃ
- ์ํํธ์จ์ด ๋ฒ์ ๊ด๋ฆฌ
- ์๋งจํฑ ๋ฒ์ (semantic versioning
- public vs assets
- useEffect
- math.h
- counter
- Jest
- ์์๊ฐ(primitive)
- stdlib.h
์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |