# Findable: settings for the /SMEProjectCanada folder (Apache / DreamHost).
# Every line is optional; the site works without this file, it just works better with it.

DirectoryIndex index.html
AddDefaultCharset utf-8
AddCharset utf-8 .html .json .csv .txt .js .webmanifest .svg
AddType application/manifest+json .webmanifest
AddType application/json .json
AddType text/javascript .js
AddType text/csv .csv
AddType application/zip .zip
AddType image/svg+xml .svg
AddType font/woff2 .woff2

<IfModule mod_headers.c>
  # Lets the blog (blog.chinookstrategy.com) read the live record count and load the fonts.
  <FilesMatch "\.(json|woff2)$">
    Header set Access-Control-Allow-Origin "*"
  </FilesMatch>
  # Pages, data and downloads are re-checked on every visit, so updates show at once. Images and fonts cache for a week.
  <FilesMatch "\.(html|json|js|webmanifest|csv|zip|txt)$">
    Header set Cache-Control "no-cache"
  </FilesMatch>
  <FilesMatch "\.(png|svg|woff2)$">
    Header set Cache-Control "public, max-age=604800"
  </FilesMatch>
  # The article may be shown inside a page on any chinookstrategy.com address (the blog's iframe fallback).
  <FilesMatch "^article\.html$">
    Header always unset X-Frame-Options
    Header always set Content-Security-Policy "frame-ancestors 'self' https://chinookstrategy.com https://*.chinookstrategy.com"
  </FilesMatch>
  Header always set X-Content-Type-Options "nosniff"
  Header always set Referrer-Policy "strict-origin-when-cross-origin"
</IfModule>

<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/plain text/css text/csv text/javascript application/javascript application/json application/manifest+json image/svg+xml
</IfModule>
