# Apache Performance Optimization
# Copy these rules to public/.htaccess or your Apache config

<IfModule mod_deflate.c>
    # Enable compression
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/json application/xml
</IfModule>

<IfModule mod_expires.c>
    ExpiresActive On
    
    # Static assets - 1 year
    <FilesMatch "\.(js|css|woff|woff2|ttf|svg|eot)$">
        ExpiresDefault "access plus 1 year"
        Header set Cache-Control "public, max-age=31536000, immutable"
    </FilesMatch>
    
    # Images - 1 year
    <FilesMatch "\.(jpg|jpeg|png|gif|webp|ico|avif)$">
        ExpiresDefault "access plus 1 year"
        Header set Cache-Control "public, max-age=31536000, immutable"
    </FilesMatch>
    
    # HTML - 1 hour (dynamic content)
    <FilesMatch "\.(html|htm)$">
        ExpiresDefault "access plus 1 hour"
        Header set Cache-Control "public, max-age=3600, must-revalidate"
    </FilesMatch>
</IfModule>

<IfModule mod_headers.c>
    # Security headers
    Header set X-Content-Type-Options "nosniff"
    Header set X-Frame-Options "SAMEORIGIN"
    Header set X-XSS-Protection "1; mode=block"
    
    # Preload headers for critical assets
    <FilesMatch "app-.*\.js$">
        Header set Link "</build/assets/react-vendor-DqE_nFma.js>; rel=preload; as=script"
    </FilesMatch>
</IfModule>

# Gzip compression
<IfModule mod_deflate.c>
    <IfModule mod_filter.c>
        AddOutputFilterByType DEFLATE text/html text/css text/javascript application/javascript application/json application/xml image/svg+xml
    </IfModule>
</IfModule>


