Skip to content
조회 수 3096 추천 수 0 댓글 7
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

아파치 mod_cache mod_disk_cache 알아보기


아파치 성능향상


아파치 모듈 mod_disk_cache


mod_disk_cache는 mod_cache가 필요하다.



설명 : Content cache storage manager keyed to URIs

상태 : Experimental

모듈명 : disk_cache_module

소스파일 : mod_disk_cache.c


top

CacheIgnoreCacheControl 지시어

설명:클라이언트가 캐쉬하지않는 내용을 요청함을 무시한다.
문법:CacheIgnoreCacheControl On|Off
기본값:CacheIgnoreCacheControl Off
사용장소:주서버설정, 가상호스트
상태:Experimental
모듈:mod_cache

보통 no-cache나 no-store 헤더값을 가진 문서는 캐쉬에 저장하지않는다.CacheIgnoreCacheControl 지시어는 이런 행동을 변경한다.CacheIgnoreCacheControl On을 사용하면 서버는 문서에 no-cache나 no-store 헤더값이 있어도 문서를 캐쉬한다. 인증이 필요한 문서는 절대로 캐쉬하지 않는다.





mod_disk_cache는 디스크기반 저장관리자를 구현한다. 이 모듈은 기본적으로 mod_proxy와 같이 사용한다.


내용을 URI를 토대로 만든 키로 캐쉬에 저장하고 가져온다. 접근보호가 된 내용은 캐쉬하지않는다.



설정 옵션

https://www.linux.co.kr/apache/apache2_manual/mod/mod_cache.html



Proxy 서버와 함께 이용할때 유용하고, 특히 WebService등에서 변화 주기가 낮은 서비스에 대해서 이 Cache 기능을 사용하면 성능 향상에 도움이 될것 같다.


LoadModule cache_module modules/mod_cache.so

LoadModule mem_cache_module modules/mod_mem_cache.so

LoadModule disk_cache_module modules/mod_disk_cache.so


<IfModule mod_cache.c>



  <IfModule mod_disk_cache.c>

    CacheRoot /env/pahache2/cache

    CacheSize 256

    CacheEnable disk /book

    CacheDirLevels 5

    CacheDirLength 3

  </IfModule>


  <IfModule mod_mem_cache.c>

    CacheEnable mem /book

    MCacheSize 4096

    MCacheMaxObjectCount 100

    MCacheMinObjectSize 1

    MCacheMaxObjectSize 2048

  </IfModule>

</IfModule>



mod_cache 설정 A

http://itrooms.tistory.com/47


<IfModule mod_cache.c>

    <IfModule mod_disk_cache.c>

        CacheEnable disk /

        CacheRoot /var/cache/mod_cache/tmp

        CacheDirLevels 2

        CacheDirLength 1

        CacheMaxFileSize 300000

        CacheMinFileSize 1

        #CacheIgnoreCacheControl On

        CacheIgnoreNoLastMod On

        CacheIgnoreQueryString Off

        CacheIgnoreHeaders None

        CacheLastModifiedFactor 0.1

        CacheDefaultExpire 300

        CacheMaxExpire 86400

        #CacheStoreNoStore On

        #CacheStorePrivate On

    </IfModule>

</IfModule>



윈도우용으로 수정 필요시 아래의 주소 참조


#아파치 #mod_cache #mod_disk_cache #urin79

<IfModule cache_module>
    <IfModule disk_cache_module>
        CacheRoot /httpd/2.2.31/cacheroot
        CacheEnable disk /
    </IfModule>
</IfModule>
지정된 CacheRoot 위치의 캐시 디렉토리에 캐시 데이터가 쌓이는지 확인한다.

윈도우용 모드캐시 완벽가이드





https://www.apachelounge.com/viewtopic.php?t=5653
<IfModule cache_module> 

   <IfModule cache_disk_module> 
       
       CacheRoot C:/temp/cache 
       CacheEnable disk / 
      CacheDirLevels 2 
        CacheDirLength 3 
      CacheIgnoreNoLastMod On 
      CacheIgnoreCacheControl On 
      CacheIgnoreQueryString Off 
      CacheDefaultExpire 3600 
      CacheMaxExpire 86400 
      CacheMaxFileSize 5000000 
    </IfModule> 
</IfModule> 
로그인 후 댓글쓰기가 가능합니다.

?
  • ?
    nanumi 2016.08.19 18:52

    http://dumpcookie.tistory.com/20

    위의 예에서 살펴보면 Expires: Cache-Control: 및 Pragma: no-cache가 붙는데, 이는 도쿠위키에서 session을 쓸 때에 자동으로 붙게되는 헤더입니다. 이를 일단 무시하도록 하기 위해서 session_start()를 찾아서 session_cache_limiter('');를 넣어주면 Expires: Cache-Control:Pragma: no-cache가 붙지 않게 되며, Cache-Control 헤더에는 s-maxage=3를 수동으로 붙여넣어 주어야 합니다.

    도쿠위키를 간단히 고쳐주면 다음과 같습니다.

     

    +    header('Cache-Control: public, s-maxage=3, max-age=0, post-check=0, pre-check=0');
         session_start();
     

    mod_disk_cache 적용시 주의할 점

    주의할 점은 이 패치는 단지 mod_disk_cache를 이런 식으로 붙일 수 있다는 것을 보여줄 뿐이지, 도쿠위키와 긴밀하게 작동하지는 않는다는 점입니다. (도쿠위키의 경우 세션을 사용하기때문에 세션 쿠키가 헤더에 붙게되는데, 이러한 쿠키는 mod_disk_cahe가 캐시를 효율적으로 하기 어렵게 합니다. 도쿠위키 및 모니위키 모두 mod_disk_cache를 십분 활용하기 위해서는 session 쿠키 등등을 최소화해서 static html로 서비스하도록 고쳐주어야 합니다.)

     

     

  • ?
    nanumi 2016.08.20 08:38

    https://www.xpressengine.com/manual/XE-1.5-Cache-Guide-ko(v1.0).pdf 캐시 사용


List of Articles
번호 분류 제목 날짜 조회 수
27 Server Server 성능 테스트 secret 2016.11.30 585
26 Server XE Content font-size:수정방법 file 2016.04.19 1864
25 컴퓨터잡담 크롬 캐시파일 삭제방법(Chrome cache file delete) file 2016.11.27 2708
24 Server [php.ini]XE 신디케이션 OpenSSL 오류문구 해결방법 file 2016.08.25 2816
23 Server XE PC에서 모바일화면 출력방법 file 2016.09.08 2835
» Server 아파치 mod_cache mod_disk_cache 알아보기 7 2016.08.18 3096
21 컴퓨터잡담 MP3 소리 크기 조절 프로그램 file 2016.08.14 3645
20 Server XE 반응형 모바일 메타태그 삽입하기 2016.08.14 3687
19 Server innodb_use_sys_malloc에 따라 The InnoDB memory heap is disabled mysql error 메시지 1 2016.08.23 3794
18 Server Minify로 CSS, JS파일, gzip으로 한꺼번에 압축해서 전송하기 file 2016.11.27 4337
17 Server 슈퍼캐시에서 .htaccess 이부분 제거해야 하나? 2016.11.23 4524
16 Server HP XW6600 E5430 SPEC file 2016.11.06 4731
15 Server 웹서버에서의 램디스크 엄청난 효과 비교하기 file 2016.11.27 4951
14 Server XpressEngine 최적화 기진곰님의 슈퍼캐시 테스트 file 2016.09.19 5015
13 Server [mysql] Created tmp disk tables 디스크 쓰기방지 대안 1 2016.11.26 5159
12 Server 윈도우용 MEMcached 설치방법 1 file 2016.09.17 5178
11 Server XE 스케치북 게시판 웹진형에서 사진과 요약글 출력방법 file 2016.12.05 5203
10 Server 램드라이브를 이용한 mysql 번개속도로 개선방법 file 2016.11.27 5238
9 Server PuTTY Download Page(telnet,ftp,ssh) file 2016.12.06 5508
8 WindowsTip 윈도우 CPU 사용률 확인, 실시간 저장하기 2016.08.24 5685
Board Pagination Prev 1 2 Next
/ 2

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소