# VS Site Vector - Static Asset Caching
# Cache static assets for 1 year (long-term caching)

<FilesMatch "\.(jpg|jpeg|png|gif|ico|css|js|svg|woff|woff2|ttf|eot|webp)$">
  # Set far-future expiration (1 year)
  <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault "access plus 1 year"
  </IfModule>

  # Cache-Control headers for long-term caching
  <IfModule mod_headers.c>
    Header set Cache-Control "public, immutable, max-age=31536000"
    Header set X-Content-Type-Options "nosniff"
  </IfModule>
</FilesMatch>

# Disable caching for HTML/PHP files (use server-side caching instead)
<FilesMatch "\.(html|htm|php)$">
  <IfModule mod_expires.c>
    ExpiresActive Off
  </IfModule>

  <IfModule mod_headers.c>
    Header set Cache-Control "no-cache, must-revalidate, max-age=0"
    Header unset ETag
  </IfModule>
</FilesMatch>

# Gzip compression for text files
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/plain
  AddOutputFilterByType DEFLATE text/html
  AddOutputFilterByType DEFLATE text/xml
  AddOutputFilterByType DEFLATE text/css
  AddOutputFilterByType DEFLATE text/javascript
  AddOutputFilterByType DEFLATE application/xml
  AddOutputFilterByType DEFLATE application/xhtml+xml
  AddOutputFilterByType DEFLATE application/rss+xml
  AddOutputFilterByType DEFLATE application/javascript
  AddOutputFilterByType DEFLATE application/x-javascript
  AddOutputFilterByType DEFLATE image/svg+xml
</IfModule>

# Security headers
<IfModule mod_headers.c>
  Header set X-Frame-Options "SAMEORIGIN"
  Header set X-XSS-Protection "1; mode=block"
</IfModule>
