aboutsummaryrefslogtreecommitdiffhomepage
path: root/public/.htaccess
diff options
context:
space:
mode:
Diffstat (limited to 'public/.htaccess')
-rw-r--r--public/.htaccess14
1 files changed, 14 insertions, 0 deletions
diff --git a/public/.htaccess b/public/.htaccess
index 4f7954f..0d23203 100644
--- a/public/.htaccess
+++ b/public/.htaccess
@@ -114,3 +114,17 @@ RewriteRule ^books/dyslexia/(.*)$ /about-dyslexia/ [R=301,L]
# --- Whisper文字起こしの記事 ---
RewriteRule ^blog/moji-okosi-whisper-surprised/?$ /whisper-to-ai-moji-okoshi/ [R=301,L]
+
+# ============================================================
+# キャッシュヘッダ
+# ============================================================
+# /_astro/ 以下のファイル名は内容のハッシュを含み、内容が変わればURLも
+# 変わるため、長期間キャッシュして問題ない。
+<IfModule mod_headers.c>
+ SetEnvIf Request_URI "^/_astro/" long_cache
+ Header set Cache-Control "public, max-age=31536000, immutable" env=long_cache
+
+ # /img/ 以下はURLが内容と対応しないため、控えめの有効期間にする。
+ SetEnvIf Request_URI "^/img/" short_cache
+ Header set Cache-Control "public, max-age=604800" env=short_cache
+</IfModule>