오늘: 8|어제: 15|전체: 234,409|회원: 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
번호 분류 제목 글쓴이 날짜 조회 수
79 토욜도 출근합니다 ㅠㅠ 2 루아틱 2013.12.13 3800
78 자유 통신사 영업정지 기간입니다 ㅋㅋ 표로 정리! file Bnrueaus™ 2014.03.08 5152
77 유머 투명인간 1 file Luatic™ 2012.04.05 6600
76 질문 트래픽 계산방식이 궁금합니다 2 Pyde 2015.08.31 208
75 자유 트래픽이 하도 안나와서 트래픽 발생용 도메인 하나 신규로 등록했네요. 1 merkava 2014.12.20 1613
74 질문 특정 기기에서 사이트 접속이 안됩니다. 1 엘티그로 2016.12.07 490
73 티베이스볼이 유일한 활력소 활어웨이 2012.09.18 12938
72 질문 티켓을 넣다가 무슨 뜻인가요? 5 1sam 2016.03.16 252
71 유머 팀워크 깨는 안정환! file Luatic™ 2012.06.05 12851
70 질문 파일질라 접속 좀 도와주세요.~ 8 하얀바나나 2015.10.29 377
69 질문 패널 접속 어캐하나요>? 3 토링넷 2015.08.04 184
68 패널장착되면 ~ 후원할 수 있게 해주세요~ 7 Larcenciel 2012.06.11 5437
67 질문 페이팔이 안되니 너무 불편하네요.. SuperSonic 2017.08.30 521
66 자유 포럼 php 7 적용완료 2 Luatic™ 2016.09.02 303
65 자유 포럼 사이트가 조용 함 ㅜㅜ 3 토링넷 2015.08.15 185
64 포럼을 분리했습니다 file YJSoft 2013.10.17 3650
63 포인트 랭킹 공간 만들어주세요 2 구공 2012.05.02 5938
62 포인트 쌓는법은;; 7 남민식 2013.10.25 5204
61 포인트 업글 생각 어떠신지.. 9 루아틱 2013.10.08 3912
60 포인트 올리는.. 4 루아틱 2013.10.16 3991
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

처음