<IfModule mod_expires.c>
  ExpiresActive On

  # Fonts
  ExpiresByType font/woff2 "access plus 1 year"
  ExpiresByType font/woff "access plus 1 year"
  ExpiresByType font/ttf "access plus 1 year"
  ExpiresByType application/font-woff2 "access plus 1 year"
  ExpiresByType application/font-woff "access plus 1 year"

  # Images
  ExpiresByType image/avif "access plus 1 year"
  ExpiresByType image/webp "access plus 1 year"
  ExpiresByType image/jpeg "access plus 1 year"
  ExpiresByType image/png "access plus 1 year"
  ExpiresByType image/gif "access plus 1 year"
  ExpiresByType image/svg+xml "access plus 1 year"
  ExpiresByType image/x-icon "access plus 1 year"

  # CSS / JS
  ExpiresByType text/css "access plus 1 month"
  ExpiresByType text/javascript "access plus 1 month"
  ExpiresByType application/javascript "access plus 1 month"

  # Data / docs
  ExpiresByType application/json "access plus 1 day"
  ExpiresByType text/html "access plus 0 seconds"
</IfModule>

<IfModule mod_headers.c>
  # Immutable for fingerprintable static assets
  <FilesMatch "\.(?:js|css|woff2|woff|ttf|avif|webp|jpe?g|png|gif|svg|ico)$">
    Header set Cache-Control "public, max-age=31536000, immutable"
  </FilesMatch>

  # HTML should revalidate
  <FilesMatch "\.(?:html?)$">
    Header set Cache-Control "no-cache, must-revalidate"
  </FilesMatch>

  # API responses should not be cached hard
  SetEnvIf Request_URI "^/slomania/api/" IS_API_REQUEST=1
  Header set Cache-Control "no-store, no-cache, must-revalidate, max-age=0" env=IS_API_REQUEST
</IfModule>

<IfModule mod_php.c>
  php_value upload_max_filesize 128M
  php_value post_max_size 256M
  php_value max_file_uploads 100
  php_value max_execution_time 300
  php_value max_input_time 300
</IfModule>
