# CubeSolver - Apache / LiteSpeed Configuration for cPanel
# 1. MIME Types
AddType text/javascript .js
AddType application/json .json

# 2. Camera & Feature Permissions Policy (Allow camera on https://bbcranger.com/cube/)
<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
    Header set Access-Control-Allow-Methods "GET, OPTIONS, HEAD"
    Header set Permissions-Policy "camera=(self)"
</IfModule>

# 3. High Performance Caching for JS Libraries
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault "access plus 1 month"
    ExpiresByType text/html "access plus 0 seconds"
    ExpiresByType text/javascript "access plus 1 year"
    ExpiresByType application/javascript "access plus 1 year"
    ExpiresByType text/css "access plus 1 year"
</IfModule>

<IfModule mod_headers.c>
    <FilesMatch "\.(js)$">
        Header set Cache-Control "public, max-age=31536000, immutable"
    </FilesMatch>
    <FilesMatch "\.(html|htm)$">
        Header set Cache-Control "no-cache, no-store, must-revalidate"
    </FilesMatch>
</IfModule>

# 4. Gzip / Deflate Compression
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/json
</IfModule>
