웹마스터 팁

AJKJ님께서 파일을 올리신 jsdelivr cdn을 사용합니다.

http://www.xpressengine.com/22768131 <- 링크참조해주세요 ^^

장점 : 트래픽이 절감되고 저사양 서버에서 속도가 향상됩니다

단점 : 코어 수정이 어려워 집니다.

*주의 : 버전을 무조건 latest로 해놓았습니다. 구버전일 경우 pull request로 jsdelivr에 파일을 업데이트 해주시면 되시고요, 구버전의 경우 파일이 없을경우 풀 리퀘스트로 추가 해주시고 ///cdn.jsdelivr.net/xe-core/latest를 ///cdn.jsdelivr.net/xe-core/'버전명'으로 접속하시면 되십니다. XE 1.7버전에서만 동작합니다.

JQUERY관련 cdn 에드온을 해제해주셔야 합니다 ^^

방법 : xe설치경로/classes/display/HTMLDisplayHandler.php를 DIFF대로 수정하시면 되십니다. ^^

DIFF ( orgin.php는 기존 파일입니다 ^^ ) :

diff --git a/orgin.php b/HTMLDisplayHandler.php
index 809c74d..d95c7d1 100644
--- a/orgin.php
+++ b/HTMLDisplayHandler.php
@@ -407,11 +407,11 @@ class HTMLDisplayHandler
 		}
 		else
 		{
-			$oContext->loadFile(array('./common/js/jquery-1.x.min.js', 'head', 'lt IE 9', -111000), true);
-			$oContext->loadFile(array('./common/js/jquery.min.js', 'head', 'gte IE 9', -110000), true);
-			$oContext->loadFile(array('./common/js/x.min.js', 'head', '', -100000), true);
-			$oContext->loadFile(array('./common/js/xe.min.js', 'head', '', -100000), true);
-			$oContext->loadFile(array('./common/css/xe.min.css', '', '', -1000000), true);
+			$oContext->loadFile(array('///cdn.jsdelivr.net/xe-core/latest/common/js/jquery-1.x.min.js', 'head', 'lt IE 9', -111000), true);
+			$oContext->loadFile(array('///cdn.jsdelivr.net/xe-core/latest/common/js/jquery.min.js', 'head', 'gte IE 9', -110000), true);
+			$oContext->loadFile(array('///cdn.jsdelivr.net/xe-core/latest/common/js/x.min.js', 'head', '', -100000), true);
+			$oContext->loadFile(array('///cdn.jsdelivr.net/xe-core/latest/common/js/xe.min.js', 'head', '', -100000), true);
+			$oContext->loadFile(array('///cdn.jsdelivr.net/xe-core/latest/common/css/xe.min.css', '', '', -1000000), true);
 		}
 
 		// for admin page, add admin css
@@ -455,7 +455,7 @@ class HTMLDisplayHandler
 		}
 		else
 		{
-			$oContext->loadFile(array('./common/css/mobile.min.css', '', '', -1000000), true);
+			$oContext->loadFile(array('///cdn.jsdelivr.net/xe-core/latest/common/css/mobile.min.css', '', '', -1000000), true);
 		}
 	}
 


XE 1.7.5.7기준으로 수정한 HTMLDisplayHandler.php를 첨부파일에 올려두었습니다 ^^

HTMLDisplayHandler.php


---------------------------------------------------------------------------------------------------

+ 수정2

AJKJ님께서 xecore 업데이트가 되었을 때 latest로 불러오면 문제가 생길 수 있다고 하십니다.

Diff을 이용해서 수정할때 ///cdn.jsdelivr.net/xe-core/latest/를 ///cdn.jsdelivr.net/xe-core/1.7/로 수정해 주세요.

* JQuery UI는 에드온을 사용하셔야 합니다. ( http://www.xpressengine.com/index.php?mid=download&package_id=22673736 )