-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8b4d464
commit 9af9d90
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<IfModule mod_rewrite.c> | ||
RewriteEngine On | ||
RewriteCond %{REQUEST_FILENAME} !-f | ||
RewriteCond %{REQUEST_FILENAME} !-d | ||
RewriteRule (.*) index.html | ||
Header set X-Spaship-Single "true" | ||
</IfModule> | ||
<IfModule mod_include.c> | ||
SSILastModified on | ||
</IfModule> | ||
|
||
ExpiresActive On | ||
|
||
# Add caching for data without extension | ||
ExpiresByType image/png M604800 | ||
|
||
ExpiresByType image/jpeg M604800 | ||
|
||
# Caching for 1 YEAR (favicon) | ||
<filesMatch "\.(ico)$"> | ||
Header set Cache-Control "max-age=29030400, public" | ||
</filesMatch> | ||
|
||
# Caching for 1 WEEK (images) | ||
<filesMatch "\.(jpg|jpeg|png|gif|svg)$"> | ||
Header set Cache-Control "max-age=604800, public" | ||
</filesMatch> | ||
|
||
# Caching for 3 HOUR (js/css) | ||
<filesMatch "\.(js|css)$"> | ||
Header set Cache-Control "max-age=604800, public" | ||
</filesMatch> | ||
|
||
# Caching for 1 HOURS (html) with revalidation | ||
<FilesMatch "\.(html)$"> | ||
Header set Cache-Control "max-age=3600, s-max-age=3600, public, no-cache" | ||
</FilesMatch> | ||
|
||
# Enable Gzip compression | ||
<IfModule mod_deflate.c> | ||
# Compress HTML, CSS, JavaScript | ||
AddOutputFilterByType DEFLATE text/html text/css application/x-javascript application/javascript | ||
</IfModule> | ||
|
||
# Ensure .mjs files are served with the correct MIME type | ||
<IfModule mod_mime.c> | ||
AddType application/javascript .mjs | ||
</IfModule> |