오늘: 5|어제: 13|전체: 235,910|회원: 118 (+0)|문서: 56,040 (+0)|댓글: 8,019 (+0)|첨부파일: 1,389 (+0)


2013.03.24 17:08

XE 속도 향상 팁

조회 수 10722 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

+ - Up Down Comment Print
?

단축키

Prev이전 문서

Next다음 문서

+ - Up Down Comment Print
1.7.3 버전에서 class/db/DBMysql.class.php 파일의
741번째줄에?
$count_query = sprintf('select count(*) as "count" %s %s', 'FROM ' . $queryObject->getFromString($with_values), ($temp_where === '' ? '' : ' WHERE ' . $temp_where));

아래에

?$count_cache = FileHandler::readFile('./files/cache/queries/total_count_'.md5($queryObject->getFromString($with_values)).'.php');
? ?if($count_cache)
? ?{
? ? if(strlen($count_cache) < 2024)
? ? {
? ? ?$count_cache = unserialize(str_replace(array('<!--?php /**','**/ ?-->'),array('',''),$count_cache));
? ? ?if($count_cache[md5($count_query)])
? ? ?{
? ? ? // cache count for 30 seconds.
? ? ? if(time() - $count_cache[md5($count_query)]['mtime'] &lt; 30)
? ? ? {
? ? ? ?$count_output = unserialize($count_cache[md5($count_query)]['data']);?
? ? ? }
? ? ? else
? ? ? {
? ? ? ?unset($count_cache[md5($count_query)]);
? ? ? }
? ? ?}
? ? }
? ? else
? ? {
? ? ?// remove too much big cache file.
? ? ?$count_cache = FileHandler::removeFile('./files/cache/queries/total_count_'.md5($queryObject-&gt;getFromString($with_values)).'.php');
? ? }
? ?}

넣어주시고 그아래 760번째 줄 쯤... 에 있는

$count_query .= (__DEBUG_QUERY__ &amp; 1 &amp;&amp; $queryObject-&gt;queryID) ? sprintf(' ' . $this-&gt;comment_syntax, $queryObject-&gt;queryID) : '';
$result_count = $this-&gt;_query($count_query, $connection);
$count_output = $this-&gt;_fetch($result_count);

이 것을

$count_query .= (__DEBUG_QUERY__&amp;1 &amp;&amp; $queryObject-&gt;queryID)?sprintf (' '.$this-&gt;comment_syntax, $queryObject-&gt;queryID):'';
? ? ? ? ? ? if(!isset($count_output))
? ?{
? ? ? ? $result_count = $this-&gt;_query($count_query, $connection);
? ? ? ? $count_output = $this-&gt;_fetch($result_count);
? ? $count_cache1[md5($count_query)]['data'] = serialize($count_output);
? ? $count_cache1[md5($count_query)]['mtime'] = time();
? ? $count_cache1[md5($count_query)]['count_query'] = $count_query;
? ? FileHandler::writeFile('./files/cache/queries/total_count_'.md5($queryObject-&gt;getFromString($with_values)).'.php','<!--?php /**'.serialize($count_cache1).'**/ ?-->');
? ?}


이렇게 바꿔주시면 게시글 목록 숫자가 캐싱됩니다.

사이트가 큰 경우 이걸로 상당히 빨라지게 할 수 있습니다.


출처:http://www.xpressengine.com/devForum/21797682


물론?http://www.ruatic.net/ltip/4400?캐시 설정도 해두시는게 좋겠죠?


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
559 질문 Ssl인증후 보안서버 설정 문의 3 roberto 2015.09.25 205
558 TIP게시판에 프로그래밍 관련된 강좌를 연속적으로 작성해도될까요? 2 CharmingIrene 2013.11.01 4454
557 VPS 관련 여러분들께 의견 듣고 싶습니다. 루아틱 2013.12.08 3881
556 질문 WHMCS 로그인이 안되는 것 같은데요 5 마래바 2016.10.29 322
555 정보 Windows 9 시작버튼 관련 영상 1 Luatic™ 2014.06.20 3926
554 질문 www 폴더 하위에 cgi-bin 폴더 제거해도 되나요? 3 라라벨 2014.06.28 3826
553 xe 1,5,3,7 설치하기 어렵군요^^ 4 S2 2012.12.04 7396
552 XE 1.5.2.5 보안 패치 업글 되었던데요~ 3 루아틱 2012.05.15 5828
551 XE 1.7.3.6 기준 추가 패치 YJSoft 2013.10.20 4573
550 XE 1.7.4 베타5 서버정보 기능 괜찮네요.. 1 루아틱 2013.12.19 10414
549 xe 게시글 수정할 때 에러 발생하시는 분을 찾습니다. 5 file 1sam 2014.01.28 3882
548 자유 xe 공홈이 리뉴얼 한다는군요 ㅎㅎ 5 torkcar 2014.03.06 5741
547 질문 xe 대상 메뉴 선택 안되는 문제 3 file 시마 2015.01.26 195
546 질문 XE 메뉴생성 삭제 문제 8 file 네비 2016.03.25 184
545 질문 XE 버전업 2 네비 2016.03.14 134
» XE 속도 향상 팁 YJSoft 2013.03.24 10722
543 질문 XE 위젯 코드 생성 5 엘티그로 2014.02.28 4454
542 질문 XE 이메일인증 관련하여 5 네비 2016.03.07 158
541 XE 자동설치가 안되네요? 3 유케님 2012.12.27 18829
540 질문 XE 최적화방법하고 잘쓰는방법은 무엇이 있을까요 3 천월 2015.04.03 258
Board Pagination ‹ Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 31 Next ›
/ 31

처음