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


2013.03.24 17:08

XE 속도 향상 팁

조회 수 10711 추천 수 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?캐시 설정도 해두시는게 좋겠죠?

?Who's YJSoft

profile

XE 초보 개발자이자 웹 개발자 YJSoft입니다


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
159 자유 할 일이 많네요. 하기는 싫은데...ㅋㅋ 6 file Bnrueaus™ 2014.03.07 5511
158 자유 오랜만에 글 쓰네요. 14 Bnrueaus™ 2014.04.06 5514
157 제로보드XE & 그누보드 차이점 9 file 가온누리 2013.02.08 5522
156 자유 게시판에서 파일 첨부가 안되네요. 8 file 퍼니엑스이 2014.03.05 5539
155 유머 일본의 다큐멘터리란?? 3 file Luatic™ 2012.03.27 5551
154 자유 ip 차단당한줄 모르고 열심히 로그인 했네요. ㅎㅎ 3 AJKJ 2014.05.17 5562
153 아직도 사이트가 조금 느리다는 느낌입니다. 11 칼킨7 2012.07.02 5567
152 점검 후 무료계정은 막안받을까 합니다. 3 루아틱 2012.06.10 5587
151 자유 현재 홈피 잘 운영되고 잇습니다 ^^ 3 torkcar 2014.02.26 5589
150 텍스타일 쓰시는분 계시나요~? 4 디지털물방울 2012.10.03 5600
149 오늘 제 실수로 루아틱님께서 고생 좀 하셨네요. 2 칼킨7 2012.05.10 5604
148 자유 글을 씁시다~~~ 21 Bnrueaus™ 2014.03.02 5604
147 XpressEngine을 쉬운 설치로 업데이트 했다가... 2 쿠아악샘 2012.09.12 5609
146 자유 다들 뭐 하시나요? Bnrueaus™ 2014.03.23 5633
145 자유 명예 사진 획득 - 사람 1 file Bnrueaus™ 2014.03.09 5640
144 자유 18일 오전 7시 및 9시 30분 현장 브리핑 내용입니다 2 Luatic™ 2014.04.18 5641
143 다들 휴가 가셧나본.. 1 루아틱 2012.08.01 5655
142 자유 돌아왓습니다 모링토크 2014.02.23 5657
141 자유 [BGM] 와 , 클라우드플레어라니! 2 file Hikoon 2014.05.03 5664
140 자유게시판이라서....주유할떄는 온도가 낮을때 하세요. 3 피사 2012.08.24 5681
Board Pagination ‹ Prev 1 ... 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Next ›
/ 31

처음