Skip to content

Commit

Permalink
Extend media and font cache TTL to 1 year (#293)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamieburchell authored Nov 14, 2021
1 parent a5893aa commit 5df6946
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 31 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/htaccess.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
run: ./bin/build.sh test/conf/.htaccess test/build/htaccess_fixture.conf

- name: Test with server-configs-test
uses: h5bp/server-configs-test@5.0.2
uses: h5bp/server-configs-test@5.1.0
with:
command: test
server: httpd
Expand All @@ -29,7 +29,7 @@ jobs:
tests: basic-file-access:cache-busting:custom-errors:forbidden-files:enforce-gzip:precompressed-files-gzip:concatenation

- name: Benchmark
uses: h5bp/server-configs-test@5.0.2
uses: h5bp/server-configs-test@5.1.0
with:
command: benchmark
server: httpd
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
"httpd.conf"
- name: Test with server-configs-test
uses: h5bp/server-configs-test@5.0.2
uses: h5bp/server-configs-test@5.1.0
with:
command: test
server: httpd
Expand All @@ -42,7 +42,7 @@ jobs:
tests: basic-file-access;cache-busting;custom-errors;forbidden-files;enforce-gzip;precompressed-files-gzip;rewrites;ssl

- name: Benchmark
uses: h5bp/server-configs-test@5.0.2
uses: h5bp/server-configs-test@5.1.0
with:
command: benchmark
server: httpd
Expand Down
54 changes: 27 additions & 27 deletions h5bp/web_performance/cache_expiration.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<IfModule mod_expires.c>

ExpiresActive on
ExpiresDefault "access plus 1 month"
ExpiresDefault "access plus 1 year"

# CSS

Expand Down Expand Up @@ -67,20 +67,20 @@

# Media files

ExpiresByType audio/ogg "access plus 1 month"
ExpiresByType image/apng "access plus 1 month"
ExpiresByType image/avif "access plus 1 month"
ExpiresByType image/avif-sequence "access plus 1 month"
ExpiresByType image/bmp "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/jxl "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType image/webp "access plus 1 month"
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType video/ogg "access plus 1 month"
ExpiresByType video/webm "access plus 1 month"
ExpiresByType audio/ogg "access plus 1 year"
ExpiresByType image/apng "access plus 1 year"
ExpiresByType image/avif "access plus 1 year"
ExpiresByType image/avif-sequence "access plus 1 year"
ExpiresByType image/bmp "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/jxl "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
ExpiresByType video/mp4 "access plus 1 year"
ExpiresByType video/ogg "access plus 1 year"
ExpiresByType video/webm "access plus 1 year"


# WebAssembly
Expand All @@ -91,28 +91,28 @@
# Web fonts

# Collection
ExpiresByType font/collection "access plus 1 month"
ExpiresByType font/collection "access plus 1 year"

# Embedded OpenType (EOT)
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
ExpiresByType font/eot "access plus 1 month"
ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
ExpiresByType font/eot "access plus 1 year"

# OpenType
ExpiresByType font/opentype "access plus 1 month"
ExpiresByType font/otf "access plus 1 month"
ExpiresByType font/opentype "access plus 1 year"
ExpiresByType font/otf "access plus 1 year"

# TrueType
ExpiresByType application/x-font-ttf "access plus 1 month"
ExpiresByType font/ttf "access plus 1 month"
ExpiresByType application/x-font-ttf "access plus 1 year"
ExpiresByType font/ttf "access plus 1 year"

# Web Open Font Format (WOFF) 1.0
ExpiresByType application/font-woff "access plus 1 month"
ExpiresByType application/x-font-woff "access plus 1 month"
ExpiresByType font/woff "access plus 1 month"
ExpiresByType application/font-woff "access plus 1 year"
ExpiresByType application/x-font-woff "access plus 1 year"
ExpiresByType font/woff "access plus 1 year"

# Web Open Font Format (WOFF) 2.0
ExpiresByType application/font-woff2 "access plus 1 month"
ExpiresByType font/woff2 "access plus 1 month"
ExpiresByType application/font-woff2 "access plus 1 year"
ExpiresByType font/woff2 "access plus 1 year"


# Other
Expand Down

0 comments on commit 5df6946

Please sign in to comment.