1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml" lang=
"ja" xml:
lang=
"ja"><head><!--
4 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5 This file is generated from xml source: DO NOT EDIT
6 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
8 <title>mod_expires - Apache HTTP サーバ
</title>
9 <link href=
"../style/css/manual.css" rel=
"stylesheet" media=
"all" type=
"text/css" title=
"Main stylesheet" />
10 <link href=
"../style/css/manual-loose-100pc.css" rel=
"alternate stylesheet" media=
"all" type=
"text/css" title=
"No Sidebar - Default font size" />
11 <link href=
"../style/css/manual-print.css" rel=
"stylesheet" media=
"print" type=
"text/css" />
12 <link href=
"../images/favicon.ico" rel=
"shortcut icon" /></head>
14 <div id=
"page-header">
15 <p class=
"menu"><a href=
"../mod/">モジュール
</a> |
<a href=
"../mod/directives.html">ディレクティブ
</a> |
<a href=
"../faq/">FAQ
</a> |
<a href=
"../glossary.html">用語
</a> |
<a href=
"../sitemap.html">サイトマップ
</a></p>
16 <p class=
"apache">Apache HTTP サーバ バージョン
2.3</p>
17 <img alt=
"" src=
"../images/feather.gif" /></div>
18 <div class=
"up"><a href=
"./"><img title=
"<-" alt=
"<-" src=
"../images/left.gif" /></a></div>
20 <a href=
"http://www.apache.org/">Apache
</a> > <a href=
"http://httpd.apache.org/">HTTP サーバ
</a> > <a href=
"http://httpd.apache.org/docs/">ドキュメンテーション
</a> > <a href=
"../">バージョン
21 2.3</a> > <a href=
"./">モジュール
</a></div>
22 <div id=
"page-content">
23 <div id=
"preamble"><h1>Apache モジュール mod_expires
</h1>
25 <p><span>言語:
</span><a href=
"../en/mod/mod_expires.html" hreflang=
"en" rel=
"alternate" title=
"English"> en
</a> |
26 <a href=
"../ja/mod/mod_expires.html" title=
"Japanese"> ja
</a> |
27 <a href=
"../ko/mod/mod_expires.html" hreflang=
"ko" rel=
"alternate" title=
"Korean"> ko
</a></p>
29 <table class=
"module"><tr><th><a href=
"module-dict.html#Description">説明:
</a></th><td>ユーザの指定した基準に基づいた
<code>Expires
</code> と
30 <code>Cache-Control
</code> HTTP ヘッダの生成
</td></tr>
31 <tr><th><a href=
"module-dict.html#Status">ステータス:
</a></th><td>Extension
</td></tr>
32 <tr><th><a href=
"module-dict.html#ModuleIdentifier">モジュール識別子:
</a></th><td>expires_module
</td></tr>
33 <tr><th><a href=
"module-dict.html#SourceFile">ソースファイル:
</a></th><td>mod_expires.c
</td></tr></table>
36 <p>このモジュールはサーバ応答の
<code>Expires
</code> HTTP ヘッダ
37 と
<code>Cache-Control
</code> ヘッダの
<code>max-age
</code> ディレクティブの
38 設定を制御します。元のファイルが作成された時刻または
39 クライアントのアクセス時刻のどちらかに基づいて期限切れ日を
43 有効性と継続性を指示します。文書がキャッシュされた場合には、
44 指定時刻に達するまでは、元の場所から取得する代わりに
45 キャッシュされているものを使うことができます。その後は、
46 キャッシュにあるコピーは期限切れ (expired) で無効であるとされ、
47 元の場所から新しいものを取得する必要があります。
</p>
49 <p><code>max-age
</code> 以外 (
<a href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9">RFC
50 2616 section
14.9</a> 参照) の
<code>Cache-Control
</code> のディレクティブを
51 操作するには
<code class=
"directive"><a href=
"../mod/mod_headers.html#header">Header
</a></code> ディレクティブを
53 <div id=
"quickview"><h3 class=
"directives">ディレクティブ
</h3>
55 <li><img alt=
"" src=
"../images/down.gif" /> <a href=
"#expiresactive">ExpiresActive
</a></li>
56 <li><img alt=
"" src=
"../images/down.gif" /> <a href=
"#expiresbytype">ExpiresByType
</a></li>
57 <li><img alt=
"" src=
"../images/down.gif" /> <a href=
"#expiresdefault">ExpiresDefault
</a></li>
61 <li><img alt=
"" src=
"../images/down.gif" /> <a href=
"#AltSyn">代替期間指定構文
</a></li>
63 <div class=
"top"><a href=
"#page-header"><img alt=
"top" src=
"../images/up.gif" /></a></div>
65 <h2><a name=
"AltSyn" id=
"AltSyn">代替期間指定構文
</a></h2>
67 <p><code class=
"directive"><a href=
"#expiresdefault">ExpiresDefault
</a></code> ディレクティブと
68 <code class=
"directive"><a href=
"#expiresbytype">ExpiresByType
</a></code> ディレクティブは
69 以下のより読み易い構文を使って定義することができます:
</p>
71 <div class=
"example"><p><code>
72 ExpiresDefault
"<base> [plus] {<num>
74 ExpiresByType type/encoding
"<base> [plus]
75 {<num> <type>}*"
78 <p><base
> は以下のどれかです:
</p>
81 <li><code>access
</code></li>
83 <li><code>now
</code> ('
<code>access
</code>' と等価)
</li>
85 <li><code>modification
</code></li>
88 <p><code>plus
</code> キーワードは省略可能です。
<num
>
89 は (
<code>atoi()
</code> が受け付ける) 整数値、
90 <type
> は以下のどれかです:
</p>
93 <li><code>years
</code></li>
94 <li><code>months
</code></li>
95 <li><code>weeks
</code></li>
96 <li><code>days
</code></li>
97 <li><code>hours
</code></li>
98 <li><code>minutes
</code></li>
99 <li><code>seconds
</code></li>
102 <p>例えば、以下のディレクティブはどれもデフォルトで文書がアクセスの
1 ヶ月後に
103 期限が切れるようにするために使えます:
</p>
105 <div class=
"example"><p><code>
106 ExpiresDefault
"access plus 1 month"<br />
107 ExpiresDefault
"access plus 4 weeks"<br />
108 ExpiresDefault
"access plus 30 days"
112 '
<num
> <type
>' 節を追加することでより細かく
115 <div class=
"example"><p><code>
116 ExpiresByType text/html
"access plus 1 month 15
118 ExpiresByType image/gif
"modification plus 5 hours 3
122 <p>修正時刻に基づいた設定を使用している場合、Expires ヘッダは
123 ディスクのファイル以外のコンテンツには
<strong>追加されない
</strong>ことに注意
124 してください。そのようなコンテンツには修正時刻は存在しないからです。
</p>
126 <div class=
"top"><a href=
"#page-header"><img alt=
"top" src=
"../images/up.gif" /></a></div>
127 <div class=
"directive-section"><h2><a name=
"ExpiresActive" id=
"ExpiresActive">ExpiresActive
</a> <a name=
"expiresactive" id=
"expiresactive">ディレクティブ
</a></h2>
128 <table class=
"directive">
129 <tr><th><a href=
"directive-dict.html#Description">説明:
</a></th><td><code>Expires
</code> ヘッダの生成を有効にする
</td></tr>
130 <tr><th><a href=
"directive-dict.html#Syntax">構文:
</a></th><td><code>ExpiresActive On|Off
</code></td></tr>
131 <tr><th><a href=
"directive-dict.html#Context">コンテキスト:
</a></th><td>サーバ設定ファイル, バーチャルホスト, ディレクトリ, .htaccess
</td></tr>
132 <tr><th><a href=
"directive-dict.html#Override">上書き:
</a></th><td>Indexes
</td></tr>
133 <tr><th><a href=
"directive-dict.html#Status">ステータス:
</a></th><td>Extension
</td></tr>
134 <tr><th><a href=
"directive-dict.html#Module">モジュール:
</a></th><td>mod_expires
</td></tr>
136 <p>このディレクティブは対応するドキュメントの領域で
137 <code>Expires
</code> と
<code>Cache-Control
</code>ヘッダを
139 (例えば、
<code>.htaccess
</code> ファイルではそのディレクトリの
140 文書のみに適用されるということです。)
<code>Off
</code> に
141 設定された場合は対応領域でそれらのヘッダは
142 生成されません (
<code>.htaccess
</code> がサーバ設定ファイルの設定を
143 上書きする、というような下位レベルでの上書きがされていなければ)。
144 <code>On
</code> に設定されていれば、ヘッダは
<code class=
"directive"><a href=
"#expiresbytype">ExpiresByType
</a></code> ディレクティブと
145 <code class=
"directive"><a href=
"#expiresdefault">ExpiresDefault
</a></code> ディレクティブ
146 の基準に従って文書にヘッダを追加します (各ディレクティブ参照)。
</p>
148 <p>このディレクティブは
<code>Expires
</code> と
149 <code>Cache-Control
</code> ヘッダの存在を
150 保証するわけではないことに注意してください。基準が満たされて
151 いない場合はヘッダは追加されず、結果としてこのディレクティブが
152 指定されていなかったかのようにさえ見えることになります。
</p>
155 <div class=
"top"><a href=
"#page-header"><img alt=
"top" src=
"../images/up.gif" /></a></div>
156 <div class=
"directive-section"><h2><a name=
"ExpiresByType" id=
"ExpiresByType">ExpiresByType
</a> <a name=
"expiresbytype" id=
"expiresbytype">ディレクティブ
</a></h2>
157 <table class=
"directive">
158 <tr><th><a href=
"directive-dict.html#Description">説明:
</a></th><td>MIME タイプによって設定される
<code>Expires
</code> ヘッダの値
</td></tr>
159 <tr><th><a href=
"directive-dict.html#Syntax">構文:
</a></th><td><code>ExpiresByType
<var>MIME-type
</var>
160 <var><code
>seconds
</var></code></td></tr>
161 <tr><th><a href=
"directive-dict.html#Context">コンテキスト:
</a></th><td>サーバ設定ファイル, バーチャルホスト, ディレクトリ, .htaccess
</td></tr>
162 <tr><th><a href=
"directive-dict.html#Override">上書き:
</a></th><td>Indexes
</td></tr>
163 <tr><th><a href=
"directive-dict.html#Status">ステータス:
</a></th><td>Extension
</td></tr>
164 <tr><th><a href=
"directive-dict.html#Module">モジュール:
</a></th><td>mod_expires
</td></tr>
166 <p>このディレクティブは指定されたタイプのドキュメント
167 (
<em>例えば
</em> <code>text/html
</code>)
168 に対して生成される
<code>Expires
</code> ヘッダと
<code>Cache-Control
</code>
169 ヘッダの
<code>max-age
</code> ディレクティブの値を定義します。
170 二つ目の引数は期限切れの日時を生成するための基準時刻に追加される
171 秒数を設定します。
<code>Cache-Control:
172 max-age
</code> は期限切れの時刻からリクエスト時刻を引いたものを秒で
175 <p>基準時刻はファイルの最終修正時刻か、クライアントのドキュメントへの
176 アクセス時刻です。どちらを使うべきかは
<code><var><code
></var></code>
177 によって指定します。
<code>M
</code> は基準時刻として
178 ファイルの最終修正時刻をという意味で、
<code>A
</code> はクライアントの
179 アクセス時刻を使うという意味になります。
</p>
181 <p>効果には微妙な違いがあります。
<code>M
</code> が使用された場合は、
182 すべてのキャッシュにある現在のドキュメントキャッシュは同時に期限が
183 切れます。これは同じ URL に毎週常に置かれる報せのようなものには
184 非常に有効です。
<code>A
</code> が使用された場合は、期限切れの
185 時間は各クライアントよって異なります。これはあまり変更されない
186 画像ファイルなど、特に関連するドキュメント群がすべて同じ画像を
187 参照するとき (
<em>すなわち
</em>画像が比較的短い期間内に繰り返し
188 アクセスされるとき) に有効です。
</p>
190 <div class=
"example"><h3>例:
</h3><p><code>
191 # enable expirations
<br />
192 ExpiresActive On
<br />
193 # expire GIF images after a month in the client's cache
<br />
194 ExpiresByType image/gif A2592000
<br />
195 # HTML documents are good for a week from the
<br />
196 # time they were changed
<br />
197 ExpiresByType text/html M604800
200 <p>このディレクティブは
<code>ExpiresActive On
</code> が指定されている
201 ときのみ有効であることに注意してください。これは、
202 指定された MIME タイプに対して
<em>のみ
</em> <code class=
"directive"><a href=
"#expiresdefault">ExpiresDefault
</a></code> ディレクティブで
203 設定された期限切れ期日を上書きします。
</p>
205 <p>この文書の前の方で説明されている
<a href=
"#AltSyn">代替構文
</a>を
206 使って期限切れ期日の計算方法を指定することもできます。
</p>
209 <div class=
"top"><a href=
"#page-header"><img alt=
"top" src=
"../images/up.gif" /></a></div>
210 <div class=
"directive-section"><h2><a name=
"ExpiresDefault" id=
"ExpiresDefault">ExpiresDefault
</a> <a name=
"expiresdefault" id=
"expiresdefault">ディレクティブ
</a></h2>
211 <table class=
"directive">
212 <tr><th><a href=
"directive-dict.html#Description">説明:
</a></th><td>期限切れ期日を計算するデフォルトアルゴリズム
</td></tr>
213 <tr><th><a href=
"directive-dict.html#Syntax">構文:
</a></th><td><code>ExpiresDefault
<var><code
>seconds
</var></code></td></tr>
214 <tr><th><a href=
"directive-dict.html#Context">コンテキスト:
</a></th><td>サーバ設定ファイル, バーチャルホスト, ディレクトリ, .htaccess
</td></tr>
215 <tr><th><a href=
"directive-dict.html#Override">上書き:
</a></th><td>Indexes
</td></tr>
216 <tr><th><a href=
"directive-dict.html#Status">ステータス:
</a></th><td>Extension
</td></tr>
217 <tr><th><a href=
"directive-dict.html#Module">モジュール:
</a></th><td>mod_expires
</td></tr>
219 <p>このディレクティブは対応する範囲のすべてのドキュメントに対して
220 デフォルトの期限切れ期日の計算アルゴリズムを設定します。
<code class=
"directive"><a href=
"#expiresbytype">ExpiresByType
</a></code> ディレクティブによって
221 タイプ毎に上書きすることができます。引数の構文はそのディレクティブの
222 説明を参照してください。また、
<a href=
"#AltSyn">代替構文
</a>も
227 <div class=
"bottomlang">
228 <p><span>言語:
</span><a href=
"../en/mod/mod_expires.html" hreflang=
"en" rel=
"alternate" title=
"English"> en
</a> |
229 <a href=
"../ja/mod/mod_expires.html" title=
"Japanese"> ja
</a> |
230 <a href=
"../ko/mod/mod_expires.html" hreflang=
"ko" rel=
"alternate" title=
"Korean"> ko
</a></p>
231 </div><div id=
"footer">
232 <p class=
"apache">Copyright
2009 The Apache Software Foundation.
<br />Licensed under the
<a href=
"http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version
2.0</a>.
</p>
233 <p class=
"menu"><a href=
"../mod/">モジュール
</a> |
<a href=
"../mod/directives.html">ディレクティブ
</a> |
<a href=
"../faq/">FAQ
</a> |
<a href=
"../glossary.html">用語
</a> |
<a href=
"../sitemap.html">サイトマップ
</a></p></div>