오늘: 2|어제: 15|전체: 233,971|회원: 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 질문 FTP의 상태가..! 8 file Sorato 2015.02.10 308
158 자유 요새 블로그 수익활동 중인데 나름 짭짤한듯. 6 file merkava 2015.02.15 402
157 자유 jsp vs asp 5 Luatic™ 2015.02.16 328
156 자유 일반인들이 해외웹호스팅을 찾는 이유를 알았습니다. merkava 2015.03.12 439
155 질문 더 이상 SSL은 판매를 안하시는 모양이군요 5 HNMaru 2015.03.18 273
154 질문 중국 IP 차단하는 방법 없을까요? 10 file Sorato 2015.03.19 458
153 자유 공홈 리뉴얼 하고.. 1 file Luatic™ 2015.03.24 201
152 자유 획기적이고 저렴한 워드프레스 테마 나왔네요 4 Luatic™ 2015.03.25 262
151 질문 워드프레스 X 테마를 설치했는데.. 2 소금빛 2015.03.27 210
150 자유 네이버와 다음에서는 제 글이 검색이 안되요 ㅜㅜ 6 MarcusLim 2015.04.02 474
149 질문 XE 최적화방법하고 잘쓰는방법은 무엇이 있을까요 3 천월 2015.04.03 241
148 자유 별 희한한 상품이 다 나오네요. 다만 광고가 좀 의심스럽네요. 3 merkava 2015.04.03 286
147 자유 스마일서브 광고문구 file merkava 2015.04.03 273
146 자유 작년 한해 루아틱을 추천해 본 결과와 그 후 생각 2 file merkava 2015.04.04 395
145 질문 html5 게임을 지정하지 않은 도메인에서 못불러오게 하는 방법 아시는 분 있나요? 3 merkava 2015.04.04 260
144 자유 오래간만에 등장! torkcar 2015.04.19 147
143 자유 프레스타샵 1.6 번역 현황 1 file Luatic™ 2015.04.21 284
142 질문 노드js 사용이 가능한가요? 2 아스트린 2015.04.29 325
141 질문 cPanel에서 기본 도메인 변경하는방법 1 Kim 2015.05.05 555
140 질문 호스팅 질문입니다. 2 다이돌이 2015.05.13 217
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

처음