Skip to content

Commit

Permalink
Add caching headers for avif images (#807)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz authored Jun 24, 2024
1 parent 457033d commit 9fd5d89
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cookbook/web-server/apache.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Let's add the Apache configuration file for the `sulu.lo` domain.
ExpiresByType image/svg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/avif "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType image/vnd.microsoft.icon "access plus 1 year"
Expand All @@ -74,7 +75,7 @@ Let's add the Apache configuration file for the `sulu.lo` domain.
</IfModule>
<IfModule mod_headers.c>
<filesMatch ".(ico|css|js|gif|webp|jpe?g|png|svg|woff|woff2|eot|ttf|mp4)$">
<filesMatch ".(ico|css|js|gif|webp|avif|jpe?g|png|svg|woff|woff2|eot|ttf|mp4)$">
Header set Cache-Control "public, max-age=31536000, immutable"
</filesMatch>
Expand Down
2 changes: 1 addition & 1 deletion cookbook/web-server/nginx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The Nginx configuration could look something like.
}
# expire
location ~* \.(?:ico|css|js|gif|webp|jpe?g|png|svg|woff|woff2|eot|ttf|mp4)$ {
location ~* \.(?:ico|css|js|gif|webp|avif|jpe?g|png|svg|woff|woff2|eot|ttf|mp4)$ {
# try to serve file directly, fallback to index.php
try_files $uri /index.php$is_args$args;
access_log off;
Expand Down

0 comments on commit 9fd5d89

Please sign in to comment.