Skip to content

Commit b30be99

Browse files
author
dhp94d
committed
feat:이미지 alt 추가
1 parent 7a1c3f7 commit b30be99

File tree

2 files changed

+68
-4
lines changed

2 files changed

+68
-4
lines changed

README.md

+56-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
- [2.3.4 이미지 lazy-load 적용](#234-이미지-lazy-load-적용)
2222
- [2.3.5 개선 결과](#235-개선-결과)
2323
- [2.4 렌더링 차단 리소스 제거하기](#24-렌더링-차단-리소스-제거하기)
24+
- [2.4.1 defer 사용하기](#241-defer-사용하기)
25+
- [2.4.2 개선 결과](#242-개선-결과)
26+
- [2.5 기본 스레드 작업 최소화 하기](#25-기본-스레드-작업-최소화-하기)
2427

2528
---
2629

@@ -345,9 +348,60 @@ cookie-consent.js가 LCP와 FCP를 방해하고 있다고 설명되어 있는데
345348
src="//www.freeprivacypolicy.com/public/cookie-consent/4.1.0/cookie-consent.js"
346349
charset="UTF-8"
347350
></script>
351+
<script type="text/javascript" charset="UTF-8">
352+
cookieconsent.run({
353+
notice_banner_type: 'simple',
354+
consent_type: 'express',
355+
palette: 'light',
356+
language: 'en',
357+
page_load_consent_levels: ['strictly-necessary'],
358+
notice_banner_reject_button_hide: false,
359+
preferences_center_close_button_hide: false,
360+
page_refresh_confirmation_buttons: false,
361+
website_name: 'Performance Course',
362+
});
363+
</script>
348364
</head>
349365
```
350366

351-
&nbsp;해당 이슈를 해결하기 위해서는 \<head> 태그에 대한 이해가 있어야 합니다.
367+
#### 2.4.1 defer 사용하기
352368

353-
&nbsp;현재 구조에서의 문제점은
369+
해당 이슈를 해결하기 위해서는 \<head> 태그에 대한 이해가 있어야 합니다.
370+
371+
&nbsp;현재 구조에서의 문제점은 \<head>태그 안에 동기적으로 스크립트를 로딩하고있는 점입니다. 이런식으로 스크립트를 헤더안에 넣으면 해당 스크립트를 완전히 다운로드하고 실행할 떄까지 다른 HTML요소의 로드를 중단합니다. 이로인해 페이지 렌더링이 느려지며, SEO또한 부정적인 영향을 줄 수 있습니다.(크롤러가 인덱싱하기 힘듬)
372+
373+
위 이슈를 해결하기 위해 비동기로 script를 동적 로딩하거나, body의 끝으로 이동하면 됩니다. 저는 body끝으로 이동시켜 defer를 적용하겠습니다.
374+
375+
```
376+
<body>
377+
<script
378+
type="text/javascript"
379+
src="//www.freeprivacypolicy.com/public/cookie-consent/4.1.0/cookie-consent.js"
380+
charset="UTF-8"
381+
defer
382+
></script>
383+
<script type="text/javascript" charset="UTF-8" defer>
384+
cookieconsent.run({
385+
notice_banner_type: 'simple',
386+
consent_type: 'express',
387+
palette: 'light',
388+
language: 'en',
389+
page_load_consent_levels: ['strictly-necessary'],
390+
notice_banner_reject_button_hide: false,
391+
preferences_center_close_button_hide: false,
392+
page_refresh_confirmation_buttons: false,
393+
website_name: 'Performance Course',
394+
});
395+
</script>
396+
</body>
397+
```
398+
399+
---
400+
401+
#### 2.4.2 개선 결과
402+
403+
<img width="776" alt="image" src="https://github.com/user-attachments/assets/66fb09e4-13e6-4235-9376-e027d5b28081">
404+
405+
통과되었습니다!!
406+
407+
### 2.5 기본 스레드 작업 최소화 하기

index.html

+12-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@
4545
<li><a href="index.html#best-sellers-section">Best Sellers</a></li>
4646
<li><a href="index.html#newsletter-section">Newsletter</a></li>
4747
<li class="menu-icon">
48-
<img src="images/menu_icon.webp" width="24" height="17" />
48+
<img
49+
src="images/menu_icon.webp"
50+
width="24"
51+
height="17"
52+
alt="menu-icon"
53+
/>
4954
</li>
5055
</ul>
5156
</nav>
@@ -116,7 +121,12 @@
116121
srcset="images/Hero_Desktop.jpg"
117122
type="image/jpg"
118123
/>
119-
<img width="1920" height="893" src="images/Hero_Desktop.jpg" />
124+
<img
125+
width="1920"
126+
height="893"
127+
src="images/Hero_Desktop.jpg"
128+
alt="hero_logo"
129+
/>
120130
</picture>
121131

122132
<div class="hero-content">

0 commit comments

Comments
 (0)