저는 워드 프레스와 테마를 사용하고 있으며 페이지 속도를 높이고 싶을 때이 테마를 약간 변경했습니다. Google Page Speed 테스터가 모든 차단 스크립트와 스타일을 제거해야한다고 말합니다.
렌더 블로킹이 무엇인지,이 문제를 해결하는 방법을 모르는 사람이 중요한 문제를 해결하도록 안내 할 수 있습니다.
감사
예를 들어 <head>
섹션이 다음과 같다고 가정 해 보겠습니다.
<!DOCTYPE html>
<html>
<head>
<title>css - How to Remove render-blocking JavaScript and StyleSheet in wordpress? - Stack Overflow</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="//cdn.sstatic.net/Js/stub.en.js?v=6c41e89d8d17"></script>
</head>
스크립트 파일을 문서의 맨 아래 또는 footer.php 파일로 이동하십시오.
<!DOCTYPE html>
<html>
<head>
<title>css - How to Remove render-blocking JavaScript and StyleSheet in wordpress? - Stack Overflow</title>
</head>
<body>
<!-- all your other codes here -->
<!-- then your scripts right before the closing body tag -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="//cdn.sstatic.net/Js/stub.en.js?v=6c41e89d8d17"></script>
</body>
</html>
모든 스크립트를 머리에서 </body>
닫는 태그 바로 앞으로 이동하면 Google 페이지 속도에서 해당 메시지가 제거됩니다.
CSS 스타일 시트에 렌더 블로킹이 있다는 오류 / 메시지가 계속 표시 될 수 있습니다. 글쎄요, 내 CSS가 문서보다 먼저 렌더링되기를 원하기 때문에 <head>
.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다