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
번호 분류 제목 날짜 조회 수
72 Server XE PC에서 모바일화면 출력방법 file 2016.09.08 2835
71 Server XE Request 줄이기 file 2016.09.07 1937
70 Server Apache에 대한 mod_proxy 지원 구성 2016.09.06 1801
69 Server [php.ini]XE 신디케이션 OpenSSL 오류문구 해결방법 file 2016.08.25 2816
68 Server innodb_use_sys_malloc to FALSE 2016.08.24 2637
67 Server innodb_use_sys_malloc에 따라 The InnoDB memory heap is disabled mysql error 메시지 1 2016.08.23 3794
66 Server XE file cache 활용 2016.08.19 1648
» Server 아파치 mod_cache mod_disk_cache 알아보기 7 2016.08.18 3096
64 Server XE 반응형 모바일 메타태그 삽입하기 2016.08.14 3687
63 Server mysql 16CPU / 16GB My.cnf 1 2016.07.26 2501
62 Server mysql 테이블 손상시 #1146 - Table 해결방법 file 2016.07.17 8905
61 Server xe 타이틀 게시판 이름 없애기 file 2016.06.28 1803
60 Server 서버 부하상태 체크 file 2016.04.30 1709
59 Server XE Content font-size:수정방법 file 2016.04.19 1864
58 Server XE <title>제목 - 사이트명</title> 으로 변경방법 2016.04.19 2055
57 Server XE 리퍼러 모듈로 트래픽 발생에 대처방법 file 2016.04.17 1409
56 Server ECS P43T-AD3, Asus C381GM, Driver(두번째 사용했던 서버 드라이버) file 2016.04.12 2804
55 Server XE 스케치북 모바일 비회원 댓글쓰기에서 홈페이지 이메일 기입란 삭제하기 2016.04.08 2979
54 Server XE 어느날 갑자기 다운로드가 되지 않을때 해결방법 file 2016.04.07 1351
53 Server 윈도우 TCP 연결의 개수를 최대한 늘이기 2016.03.26 3452
Board Pagination Prev 1 2 3 4 5 Next
/ 5

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


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

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

설치 취소