RadarURL
Skip to content
조회 수 2402 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

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

단축키

Prev이전 문서

Next다음 문서

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

apache에서는 mod_expires 모듈을 통해 Expires HTTP header 를 설정할 수 있다.
이를 통하여 클라이언트(웹페이지 방문자)에 캐싱되는 문서나 이미지들이 많아서 트래픽을
감소시킬 수 있다. 이미지 전용 서버나 이미지 디렉토리에 설정을 해두면 효과적이다.

이미지 서버에 지정한 다음 예를 보자.

-----------------------------------------------------------
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 month"

# 제외할 디렉토리
<Directory "/usr/local/apache/htdocs/temp">
ExpiresActive Off
</Directory>
</IfModule>
-----------------------------------------------------------

- ExpiresActive On 지시자로 Expires 설정을 enable 한다.
- ExpiresDefault "access plus 1 month" 지시자는 액세스한지 얼마나 지나서 expire할 것인지를 지정한다.
즉, 지정한 기간만큼 클라이언트에 캐싱이 된다. 위에는 1달이다.

이외에 클라이언트에서 액세스한지 1달, 4주, 30일, 1년 등과 같은 expire 주기와
서버의 파일의 수정 시간으로 expire 주기를 설정할 수 있다.

-----------------------------------------------------------
ExpiresDefault "access plus 1 month"
ExpiresDefault "access plus 4 weeks"
ExpiresDefault "access plus 30 days"
ExpiresDefault "access plus 1 years"
ExpiresDefault "modification plus 30 days"
-----------------------------------------------------------

- 설정 마지막부분에 Directory 지시자와 ExpiresActive Off 설정을 통해
특정 디렉토리만 expire 설정에서 제외할 수 있다.
반대로 특정 디렉토리만 On으로도 설정할 수 있다. (일반 웹서버에 /images 와 같이 디렉토리가 있는 경우)

-----------------------------------------------------------
ExpiresByType image/gif "acces plus 4 weeks"
-----------------------------------------------------------

- 위처럼 파일의 유형으로도 가능하다.

아주 간단하지 않는가?

참고로 [다음(daum)] 의 이미지 서버는 28일(4주)로 [야후!코리아] 는 5년으로 설정되어 있다.

** 아파치 문서 http://httpd.apache.org/docs/mod/mod_expires.html 

 

출처 : http://www.asm.ne.kr/index.php?mid=xetip&listStyle=list&page=1&sort_index=regdate&order_type=desc&document_srl=34628

?

List of Articles
번호 제목 글쓴이 날짜 조회 수
71 아파치 httpd.conf 재시작 없이 설정 적용하기 JAESOO 2016.05.02 270
70 톰캣 8 소개 JAESOO 2016.01.01 338
69 리눅스 아파치 로그 뷰어 webalizer, utf-8로 변환하기 JAESOO 2014.12.22 544
68 Webalizer Configuration – Configure Webalizer for SEO JAESOO 2014.12.22 803
67 Webalizer, AWStats에서 국가 정보 확인하기 JAESOO 2014.12.22 440
66 Webalizer에서 국가별 로그 출력하기 JAESOO 2014.12.22 777
65 Apache: A good Webalizer.conf for the Webalizer Apache Log Analyzer utility JAESOO 2014.12.22 1236
64 아파치 로그분석 webalizer 설치 JAESOO 2014.12.21 481
63 Permission denied: .htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable JAESOO 2014.12.19 743
62 Permission denied: /home/.htaccess pcfg_openfile: unable to check htaccess file JAESOO 2014.12.19 507
61 pcfg_openfile: unable to check htaccess file, ensure it is readable JAESOO 2014.12.19 521
60 Tomcat 버전별 설명 JAESOO 2014.06.04 2272
59 Apache 실행환경을 nobody 사용자로 변경 JAESOO 2014.05.28 1510
58 리눅스 사용자 계정별 웹서버 운영하기 JAESOO 2014.05.27 1872
57 Apache 서버에서 확장자 .htm 파일 내의 php 코드가 실행되지 않는 문제 해결 방법 JAESOO 2014.05.26 1692
56 php 웹사이트에서 파일을 업로드 하는중 100%에서 멈춰버리는 현상 해결 JAESOO 2014.05.16 1826
55 Apache Struts 버전 확인 방법 JAESOO 2014.05.09 2166
54 robots.txt를 현명하게 사용하는 방법 JaeSoo 2014.04.11 1752
53 robots.txt 파일(로봇배제 표준) JaeSoo 2014.04.11 1759
52 Windows / apache_2.4.3 + php_5.4.10 + mod_fcgid_2.3.7 JaeSoo 2013.04.18 4211
Board Pagination Prev 1 2 3 4 Next
/ 4

PageViews   Today : 11321 Yesterday : 5037 Total : 21967373  /  Counter Status   Today : 10954 Yesterday : 4602 Total : 1193677

Edited by JAESOO

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


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

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

설치 취소