오늘: 1|어제: 15|전체: 233,504|회원: 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
번호 분류 제목 글쓴이 날짜 조회 수
159 감사합니다. 처음이라 ftp만 이용했는데 kth랑 스피트가 비슷한뜻? 1 닉스 2013.04.05 11220
158 유머 고백하려해 - 악동뮤지션 (듣기, 가사, 영상) 루아틱 2013.03.31 8164
157 중국쪽은 전부 막히는건가요? 7 천둔 2013.03.29 10676
» XE 속도 향상 팁 YJSoft 2013.03.24 10711
155 .free 무료 도메인 예약신청 하세요~ :) 1 햄쥐 2013.03.23 12456
154 여기서 그누보드 쓰는사람이 없나봐요.. 8 가온누리 2013.03.21 6977
153 접속이 안되었던 이유라도... 2 천둔 2013.03.20 10403
152 홈페이지 세로 업데이트 했어요.^^ 가온누리 2013.03.18 10907
151 현재 홈페이지 적용할려고 하는중...!! 7 file 가온누리 2013.03.17 7044
150 아이디가 짤렸네요 ^^;;; 4 shinjite 2013.03.13 10869
149 제 사이트도 1.7 업글했습니다 YJSoft 2013.03.11 10446
148 감기+황사 3 피사 2013.03.08 6882
147 xe1.7 버전 에서.. 숙지황 2013.03.07 7736
146 가입됫네요 ...방갑습니다 4 사랑초잎 2013.03.03 10900
145 홈페이지 호스트 관련 초보적인 질문 3 키텔 2013.03.02 11296
144 워드프레스 테마 2개 동시에 가동 가능할까요? 4 귤귤 2013.03.02 6179
143 쇼셜 테스트 ... 5 devwit_org 2013.03.01 9232
142 홈페이지 어떤형식으로 만들까 고민중이고...ㅠㅠ 7 가온누리 2013.02.19 5268
141 게시판이 좀 썰렁하네요... 8 가온누리 2013.02.19 4980
140 imageshack 라는 곳 1 바다새 2013.02.16 5404
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

처음