오늘: 21|어제: 56|전체: 234,959|회원: 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
번호 분류 제목 글쓴이 날짜 조회 수
79 XE 코어가 많이 업데이트되었네요 2 비맞인제비 2012.07.06 5361
78 루아틱무료호스팅중에 광고무료호스팅은뭔가요? 3 file 호롤로로로 2012.07.06 5244
77 여기무료호스팅은 설치비안받나요? 1 호롤로로로 2012.07.06 5362
76 POP3로 타메일에서 이곳 메일 가져올때 메일서버 주소! 4 Larcenciel 2012.07.04 5249
75 아직도 사이트가 조금 느리다는 느낌입니다. 11 칼킨7 2012.07.02 5567
74 블소 업할때 모습 날개가 짠~ 1 file 루아틱 2012.06.23 5401
73 블소 남캐릭 스샷 file 루아틱 2012.06.23 5182
72 여름이네요... 9 구공 2012.06.18 4818
71 요즘은 동영상 편집을 조금씩 연습하고 있습니다. 2 쿠아악샘 2012.06.17 5727
70 코모도 구글 광고 SSL 인증서 90일간 무료네요 루아틱 2012.06.17 5184
69 유머 f(x)의 Jet 와 Electric Shock 6 똥폼 2012.06.16 8999
68 유머 학교 가기 싫어요 4 file 쿠아악샘 2012.06.14 14093
67 이제 일어낫더니 멍하네요 ㅇㅅㅇ; 루아틱 2012.06.14 5299
66 유머 MRI의 뜻 4 file 똥폼 2012.06.12 12453
65 패널장착되면 ~ 후원할 수 있게 해주세요~ 7 Larcenciel 2012.06.11 5437
64 점검 후 무료계정은 막안받을까 합니다. 3 루아틱 2012.06.10 5587
63 지하철에서 싸우는 사람을 봣는데.... 10 Larcenciel 2012.06.10 5130
62 유머 팀워크 깨는 안정환! file Luatic™ 2012.06.05 12851
61 한가지 좋은소식이랄까... 2 루아틱 2012.06.05 5359
60 루아틱으로 벌수있는 수입이 전혀 없군요 = ㅅ=; 7 루아틱 2012.06.04 5157
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

처음