# VIP178 PWA Shortcut Page
# Deploy ke: /install/vip178/

# Serve manifest dengan MIME type yang benar
AddType application/manifest+json .webmanifest

# Serve webp
AddType image/webp .webp

# Serve avif
AddType image/avif .avif

# Service Worker harus bisa diakses dari scope /install/vip178/
# dan harus serve dengan header yang benar
<Files "sw.js">
    Header set Service-Worker-Allowed "/install/vip178/"
    Header set Cache-Control "no-cache, no-store, must-revalidate"
</Files>

# Manifest juga no-cache supaya update langsung kena
<Files "manifest.webmanifest">
    Header set Cache-Control "no-cache, no-store, must-revalidate"
</Files>

# Cache assets gambar 7 hari
<FilesMatch "\.(png|webp|avif|jpg|jpeg|gif|svg|ico)$">
    Header set Cache-Control "public, max-age=604800"
</FilesMatch>

# HTTPS redirect
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
