오늘: 5|어제: 17|전체: 234,268|회원: 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
번호 분류 제목 글쓴이 날짜 조회 수
599 자유 @럭키라이팅 19 YJSoft 2014.02.16 6581
598 자유 blue host wordpress vps hosting인데 어떻게들 생각하시나요? 5 file merkava 2015.01.18 278
597 자유 brackets 에디터 쓰는 분 있나요? help 2015.12.10 172
596 자유 CentOS 5 설치중 +=+ 69 file Bnrueaus™ 2014.02.27 8180
595 cpanel 너무 좋군요 ㅇㅅㅇ; 12 루아틱 2012.05.26 6447
594 질문 cPanel 접속이 안됩니다. 3 데카 2015.08.19 206
593 질문 cPanel에서 기본 도메인 변경하는방법 1 Kim 2015.05.05 555
592 질문 DNS 서버 때문에 고민입니다. 10 하얀바나나 2015.09.30 359
591 자유 eset 백신 저렴하게 판매하네요. file merkava 2016.05.06 384
590 질문 exec로 동시접속자 수 체크하려구 하는데.. 2 Sorato 2015.09.03 234
589 유머 f(x)의 Jet 와 Electric Shock 6 똥폼 2012.06.16 8999
588 자유 ForHanbi 님이 마켓에다 배포하신 레이아웃 1 torkcar 2014.03.17 6205
587 자유 Forums gratuits calme. 10 凹凸™ 2014.02.23 6378
586 질문 ftp 접속에 관한 질문입니다. 4 재웅 2015.06.06 1635
585 질문 FTP 접속이 잘 안되는 것 같은데... 2 misol 2016.10.17 700
584 질문 FTP의 상태가..! 8 file Sorato 2015.02.10 308
583 정보 G-STAR 국제게임전시회 file 네비 2014.10.03 2782
582 질문 html5 게임을 지정하지 않은 도메인에서 못불러오게 하는 방법 아시는 분 있나요? 3 merkava 2015.04.04 260
581 유머 I have a dream 凹凸™ 2014.02.23 3719
580 ie10은 지원을 안하나보네요. 10 shinjite 2013.12.01 3286
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

처음