# ========================================================
# Hostinger & Linux Zero-Bug Configuration
# ========================================================

# 1. UTF-8 Encoding
AddDefaultCharset UTF-8
AddCharset UTF-8 .html .css .js .json .svg

# 2. Correct MIME Types
<IfModule mod_mime.c>
  AddType image/svg+xml .svg .svgz
  AddType image/webp .webp
  AddType font/woff2 .woff2
  AddType font/woff .woff
  AddType font/ttf .ttf
  AddType application/json .json
  AddType text/javascript .js
  AddType text/css .css
</IfModule>

# 3. Enable GZIP Compression for Ultra-Fast Loading
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript
  AddOutputFilterByType DEFLATE application/javascript application/json application/xml
  AddOutputFilterByType DEFLATE image/svg+xml
</IfModule>

# 4. Anti-Cache / Live Updates Engine
# Ensures clients always see the latest presentation updates without browser caching issues
<IfModule mod_headers.c>
  # HTML, CSS, JS: Never cache aggressively
  <FilesMatch "\.(html|htm|js|css)$">
    Header set Cache-Control "no-cache, no-store, must-revalidate, max-age=0"
    Header set Pragma "no-cache"
    Header set Expires "0"
  </FilesMatch>

  # Images and fonts: Cache lightly with validation
  <FilesMatch "\.(png|jpg|jpeg|gif|webp|svg|woff2|woff)$">
    Header set Cache-Control "public, max-age=3600, must-revalidate"
  </FilesMatch>
</IfModule>

# 5. Security & Fallbacks
Options -Indexes
DirectoryIndex index.html index.php
