新增功能: - 將首頁進入方式改為滑動解鎖(藍色滑塊和文字) - 實現多層次快取清除機制(版本檢測、自動清除) - 新增 .htaccess 快取控制(HTML 不快取、靜態資源優化) - 調整 Logo 尺寸為 250px - 修復「回上頁」按鈕功能 技術改進: - 支援滑鼠和觸控雙模式 - 智能版本檢測與快取管理 - 保留重要資料(登入狀態、Supabase 設定) - 優化建置輸出(含快取清除腳本) 文件: - CACHE_CLEARING_GUIDE.md - 快取清除機制說明 - SITEGROUND_DEPLOYMENT_GUIDE.md - SiteGround 部署指南 - DEPLOYMENT_CHECKLIST.md - 部署檢查清單
45 lines
1.4 KiB
ApacheConf
45 lines
1.4 KiB
ApacheConf
<IfModule mod_rewrite.c>
|
|
RewriteEngine On
|
|
RewriteBase /
|
|
RewriteRule ^index\.html$ - [L]
|
|
RewriteCond %{REQUEST_FILENAME} !-f
|
|
RewriteCond %{REQUEST_FILENAME} !-d
|
|
RewriteRule . /index.html [L]
|
|
</IfModule>
|
|
|
|
# Prevent caching of HTML files (always get fresh version)
|
|
<FilesMatch "\.(html|htm)$">
|
|
<IfModule mod_headers.c>
|
|
Header set Cache-Control "no-cache, no-store, must-revalidate"
|
|
Header set Pragma "no-cache"
|
|
Header set Expires "0"
|
|
</IfModule>
|
|
</FilesMatch>
|
|
|
|
# Enable GZIP compression
|
|
<IfModule mod_deflate.c>
|
|
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/json
|
|
</IfModule>
|
|
|
|
# Browser caching for static assets only
|
|
<IfModule mod_expires.c>
|
|
ExpiresActive On
|
|
ExpiresByType image/jpg "access plus 1 year"
|
|
ExpiresByType image/jpeg "access plus 1 year"
|
|
ExpiresByType image/gif "access plus 1 year"
|
|
ExpiresByType image/png "access plus 1 year"
|
|
ExpiresByType image/svg+xml "access plus 1 year"
|
|
ExpiresByType text/css "access plus 1 month"
|
|
ExpiresByType application/javascript "access plus 1 month"
|
|
ExpiresByType text/javascript "access plus 1 month"
|
|
</IfModule>
|
|
|
|
# Add version to static files for cache busting
|
|
<IfModule mod_headers.c>
|
|
# For CSS and JS files, use ETag for cache validation
|
|
<FilesMatch "\.(js|css)$">
|
|
Header set Cache-Control "public, max-age=2592000"
|
|
FileETag MTime Size
|
|
</FilesMatch>
|
|
</IfModule>
|