# ENH-017: WebP MIME type and aggressive caching for image derivatives
# Deploy to: /var/www/vhosts/aeihawaii.com/httpdocs/scheduler/uploads/.htaccess

# Ensure WebP is served with correct MIME type
AddType image/webp .webp

# Aggressive caching for derivative images (thumbs/webp are immutable once generated)
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType image/webp "access plus 1 year"
  ExpiresByType image/jpeg "access plus 1 month"
  ExpiresByType image/png "access plus 1 month"
</IfModule>

<IfModule mod_headers.c>
  <FilesMatch "\.(webp)$">
    Header set Cache-Control "public, max-age=31536000, immutable"
  </FilesMatch>
  <FilesMatch "\.(jpg|jpeg|png|gif)$">
    Header set Cache-Control "public, max-age=2592000"
  </FilesMatch>
</IfModule>
