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
번호 분류 제목 날짜 조회 수
717 컴퓨터잡담 윈도우 진입후 익스플로러 연결 딜레이 현상 2011.06.20 4189
716 컴퓨터잡담 윈도우 오류보고(블루스크린) 해결 2011.12.17 4131
715 컴퓨터잡담 윈도우 시스템 파일 콘솔복원 2 2011.11.30 5167
714 컴퓨터잡담 윈도우 서비스 수동 등록 방법 2010.07.23 9657
713 WindowsTip 윈도우 빠른종료 팁 file 2014.12.27 1824
712 WindowsTip 윈도우 문제 많을때 (레지스트리 초기화???) 2012.05.23 9634
711 WindowsTip 윈도우 레지스트리 설정 - 인터넷 익스플로러 4 2013.02.28 12953
710 컴퓨터잡담 윈도우 기본 애플리케이션 명령어 2011.12.21 4571
709 WindowsTip 윈도우 Xp에서 사용자 로그온 제거 방법 1 2012.05.18 6292
708 컴퓨터잡담 윈도우 XP에서 메모리를 시스템 캐시로 설정하는 방법 file 2012.03.08 4952
707 WindowsTip 윈도우 XP에서 exFAT 인식 패치방법 file 2015.01.14 1558
706 WindowsTip 윈도우 XP SP3 와 Windows 8.1 두가지 부팅 메뉴얼 file 2015.02.11 1768
705 Server 윈도우 time_wait 없애기 2016.03.08 3920
704 Server 윈도우 TCP 연결의 개수를 최대한 늘이기 2016.03.26 3508
703 컴퓨터잡담 윈도우 PC에서 안드로이드 앱 실행 file 2018.09.25 6211
702 WindowsTip 윈도우 ip helper ipv6 도데체 무엇인가? 2015.05.11 4916
701 WindowsTip 윈도우 DLL 오류 해결방법 2013.01.23 192718
700 WindowsTip 윈도우 CPU 사용률 확인, 실시간 저장하기 2016.08.24 5686
699 WindowsTip 윈도우 8.1 종료버튼 만들기 file 2015.03.21 3851
698 WindowsTip 윈도우 8.1 업데이트 하지 않기 file 2015.03.21 3777
Board Pagination Prev 1 ... 9 10 11 12 13 ... 46 Next
/ 46

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


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

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

설치 취소