
# =========================================================================
# CACHE CONTROL - Paksa browser selalu ambil JS/CSS terbaru dari server
# Solusi agar semua user otomatis dapat update tanpa perlu clear cache
# =========================================================================
<IfModule mod_headers.c>
    # JS dan CSS: no-cache (cek ke server, ambil baru jika berubah)
    <FilesMatch "\.(js|css)$">
        Header set Cache-Control "no-cache, must-revalidate"
        Header unset ETag
    </FilesMatch>
    # Gambar dan font: cache 7 hari (jarang berubah)
    <FilesMatch "\.(png|jpg|jpeg|gif|ico|woff|woff2|ttf)$">
        Header set Cache-Control "public, max-age=604800"
    </FilesMatch>
    # PHP: jangan pernah di-cache
    <FilesMatch "\.php$">
        Header set Cache-Control "no-store, no-cache, must-revalidate"
    </FilesMatch>
</IfModule>

# Nonaktifkan ETags untuk mencegah cache stale
<IfModule mod_headers.c>
    Header unset ETag
</IfModule>
FileETag None

# Upload limit untuk file CBS Excel
<IfModule mod_php.c>
    php_value upload_max_filesize 32M
    php_value post_max_size 32M
    php_value max_execution_time 120
    php_value memory_limit 256M
</IfModule>

RewriteEngine on
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-SSL} !on
RewriteCond %{HTTP_HOST} ^patarulaba\.it\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.patarulaba\.it\.com$
RewriteRule ^/?$ "https\:\/\/patarulaba\.it\.com\/" [R=301,L]

