오늘: 4|어제: 15|전체: 234,219|회원: 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
번호 분류 제목 글쓴이 날짜 조회 수
619 자유 흠.. 챗방 오셔서 저 찾는분.. 1 Luatic™ 2015.06.09 225
618 흠 도대체왜이러는걸까요... 3 네비 2013.11.24 4284
617 흠 다들 바쁘신가요? 5 네비 2013.11.17 5149
616 휴가끝!! 14 Larcenciel 2012.04.04 7319
615 유머 휴가 나와서 펑펑 운 사건 file Larcenciel 2012.04.05 6133
614 훔.. 5 루아틱 2012.04.16 6954
613 훔 MariaDB를 심각히 고려중입니다. + ㅅ+; 루아틱 2013.12.22 3945
612 후후.. 오랜만에오네요.. 윈도우8과 2012데이터센터 ! 3 Larcenciel 2012.09.03 6993
611 자유 획기적이고 저렴한 워드프레스 테마 나왔네요 4 Luatic™ 2015.03.25 262
610 회원분들 분포는 어떻게되시나여? 3 CharmingIrene 2013.10.31 5025
609 회사일이바뻐 제 사이트 작업이 늦어지고있네요..ㅠ 세브첸코 2013.12.06 4101
608 화창한 봄의 아침... 1 구공 2012.04.27 6410
607 화창 14 구공 2012.04.04 7349
606 유머 화끈한 여친의 위문편지 file Luatic™ 2012.04.08 12220
605 홈피가 완공되엇으니 이제 글을 올리자~ 오필리아 2013.10.06 4490
604 홈페이지를 조금 더 꾸며 보았습니다. 3 file YJSoft 2013.10.15 3904
603 질문 홈페이지 회원정보백업... 2 file 네비 2014.11.08 3221
602 홈페이지 호스트 관련 초보적인 질문 3 키텔 2013.03.02 11296
601 홈페이지 어떤형식으로 만들까 고민중이고...ㅠㅠ 7 가온누리 2013.02.19 5268
600 홈페이지 세로 업데이트 했어요.^^ 가온누리 2013.03.18 10907
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

처음