오늘: 16|어제: 14|전체: 233,999|회원: 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?캐시 설정도 해두시는게 좋겠죠?


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
599 홈페이지 호스트 관련 초보적인 질문 3 키텔 2013.03.02 11296
598 감사합니다. 처음이라 ftp만 이용했는데 kth랑 스피트가 비슷한뜻? 1 닉스 2013.04.05 11220
597 방문자 통계 및 로그 서비스 piwik 써보세요~ 4 file 루아틱 2012.05.10 10949
596 홈페이지 세로 업데이트 했어요.^^ 가온누리 2013.03.18 10907
595 가입됫네요 ...방갑습니다 4 사랑초잎 2013.03.03 10900
594 아이디가 짤렸네요 ^^;;; 4 shinjite 2013.03.13 10869
593 타인의 소유라는 메시지는 왜 2 천둔 2013.04.12 10791
» XE 속도 향상 팁 YJSoft 2013.03.24 10711
591 자유 설문조사 한번 해봅니다. 몇가지 됩니다. 많은 참여 바래요~ 13 Luatic™ 2013.12.17 10699
590 중국쪽은 전부 막히는건가요? 7 천둔 2013.03.29 10676
589 제 사이트도 1.7 업글했습니다 YJSoft 2013.03.11 10446
588 접속이 안되었던 이유라도... 2 천둔 2013.03.20 10403
587 XE 1.7.4 베타5 서버정보 기능 괜찮네요.. 1 루아틱 2013.12.19 10402
586 유머 [뮤비] SHINee 샤이니_Sherlock?셜록 (Clue + Note)_Music Video 루아틱 2012.04.17 9754
585 홈 접속이 안되는군요 ㅜㅜ 2 S2 2012.12.08 9307
584 소셜 xe API 요청 문제로 문의드립니다. 1 planet3D 2012.11.30 9258
583 쇼셜 테스트 ... 5 devwit_org 2013.03.01 9232
582 아까 보니까 1 file 활어웨이 2012.11.04 9161
581 유머 f(x)의 Jet 와 Electric Shock 6 똥폼 2012.06.16 8999
580 제 경험으로 비추어본 XE 500 에러의 원인.. 2 Larcenciel 2012.03.29 8583
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

처음