오늘: 15|어제: 15|전체: 234,230|회원: 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 XE 자동설치가 안되네요? 3 유케님 2012.12.27 18811
618 안녕하세요.. 3 구공 2012.03.26 14651
617 유머 남자분들 찜질방에서 잠 잘때.. 2 file Luatic™ 2012.04.17 14412
616 유머 학교 가기 싫어요 4 file 쿠아악샘 2012.06.14 14092
615 유머 [뮤비] Sistar(씨스타) - Alone(나혼자) 루아틱 2012.04.17 14065
614 유머 [뮤비] BIGBANG - FANTASTIC BABY M/V 루아틱 2012.04.17 13157
613 유머 여친과 1박 2일 여행 설득하기 루아틱 2012.04.17 13081
612 티베이스볼이 유일한 활력소 활어웨이 2012.09.18 12938
611 유머 팀워크 깨는 안정환! file Luatic™ 2012.06.05 12851
610 유머 [뮤비] Jennifer Lopez - Dance Again ft. Pitbull 루아틱 2012.04.17 12776
609 .free 무료 도메인 예약신청 하세요~ :) 1 햄쥐 2013.03.23 12456
608 유머 MRI의 뜻 4 file 똥폼 2012.06.12 12453
607 유머 이만기에게 대중탕이란.. 2 루아틱 2012.06.01 12399
606 (설문) 루아틱에서 서비스 했으면 하는 것은? 8 루아틱 2013.02.09 12257
605 유머 화끈한 여친의 위문편지 file Luatic™ 2012.04.08 12220
604 유머 일본의 몰래 카메라 (일반 시민 대상) 루아틱 2012.04.17 12183
603 유머 노스페이크 - 급똥 오브 레전드 루아틱 2012.04.08 12146
602 속도 빠르네요 ^^. 15 알찬돌삐 2013.04.18 12061
601 유머 빵맛이 ㅈ 같에요 1 file Luatic™ 2012.04.08 11924
600 새직장 구하기 전 .. 심심풀이로 만들어보고 있는.. 것? 1 file 루아틱 2012.08.21 11852
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

처음