오늘: 16|어제: 15|전체: 234,262|회원: 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 질문 지..질문이 하나 더..큼큼 1 YJUNE 2016.06.25 152
598 질문 님들 결제후 청구서 오나요? 2 torkcar 2015.07.28 157
597 자유 그런데 cpanel에 휴지통 기능이 있었네요. 1 merkava 2015.08.19 157
596 질문 루아틱 서버에서 Git 사용하는 방법? 1 1sam 2016.03.10 159
595 질문 또 폴더 권한에 대해서 질문드려요.ㅠ- 3 하얀바나나 2015.11.13 161
594 자유 유머-흔한 해외웹호스팅 제휴수익을 위한 유인글 file merkava 2016.03.10 162
593 자유 역시 캐쉬플러그인을 잘쓰니 빨라지는듯. file merkava 2016.03.18 163
592 질문 질문입니다. 1 YJUNE 2016.07.02 166
591 자유 현재로선.. 다중 php 지원시... Luatic™ 2015.12.09 168
590 자유 드뎌 결제완료 1 핫슈 2016.07.01 170
589 자유 brackets 에디터 쓰는 분 있나요? help 2015.12.10 172
588 질문 XE 메뉴생성 삭제 문제 8 file 네비 2016.03.25 173
587 질문 PDO 확장모듈은 무엇인가요? 1 1sam 2016.04.15 175
586 자유 계정신청 ㅋ 1 torkcar 2015.05.27 176
585 질문 죄송합니다. 또 여쭤보네요.. 3 YJUNE 2015.08.22 178
584 자유 이제 드디어 진짜겨울인가요 5 종희 2015.12.03 178
583 질문 채팅방질문 6 천월 2015.08.12 180
582 질문 소문자, 대문자 사용을 여쭤봅니다. 2 하얀바나나 2015.10.28 182
581 자유 컴퓨터 사면 루아틱으로 길드 홈피 만들어야징 ㅋ torkcar 2015.05.23 183
580 자유 입주가 화요일날 시작하내용 ㅋ 토링넷 2015.07.31 183
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

처음