오늘: 5|어제: 13|전체: 234,166|회원: 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
번호 분류 제목 글쓴이 날짜 조회 수
159 자유 이런 애들 보면 짜증이 밀려 옵니다. 3 file merkava 2015.10.02 296
158 질문 이런데 써도 되는진 모르겠다만은.. 5 YJUNE 2016.06.14 218
157 이렇게 해서 포인트 올라가니까 조금 미안한데... 3 file 바다새 2014.01.28 3344
156 유머 이만기에게 대중탕이란.. 2 루아틱 2012.06.01 12399
155 자유 이야 겨우 무료 SSL (3년짜리) 서버에 적용하여.. 이용하네요 .. file TheSTREET 2016.07.31 320
154 질문 이용문의 문의드립니다. 2 아이보리 2014.03.04 4250
153 질문 이정도 사이트 만들려면 뭘 얼마나 공부해야하나요? 3 검은바다 2014.05.04 4186
152 자유 이제 댓글은 써진다... Bnrueaus™ 2014.04.25 4772
151 자유 이제 드디어 진짜겨울인가요 5 종희 2015.12.03 178
150 이제 일어낫더니 멍하네요 ㅇㅅㅇ; 루아틱 2012.06.14 5299
149 유머 이해하면 웃긴사진 file 이하늘 2013.10.21 4942
148 자유 일반인들이 해외웹호스팅을 찾는 이유를 알았습니다. merkava 2015.03.12 439
147 유머 일본의 다큐멘터리란?? 3 file Luatic™ 2012.03.27 5551
146 유머 일본의 몰래 카메라 (일반 시민 대상) 루아틱 2012.04.17 12183
145 질문 입주 후 궁금한게 있어 여쭤봅니다. 10 YJUNE 2015.08.21 235
144 자유 입주가 화요일날 시작하내용 ㅋ 토링넷 2015.07.31 183
143 자동결제 사이트 번역중입니다 2 루아틱 2013.11.21 4455
142 자유게시판이라서....주유할떄는 온도가 낮을때 하세요. 3 피사 2012.08.24 5681
141 자유 작년 한해 루아틱을 추천해 본 결과와 그 후 생각 2 file merkava 2015.04.04 395
140 자유 잠수타다 다시 왔어요! MarcusLim 2017.01.20 409
Board Pagination ‹ Prev 1 ... 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Next ›
/ 31

처음