Skip to content

Commit

Permalink
Unify .htaccess with maximum cache for everything but html and xml
Browse files Browse the repository at this point in the history
  • Loading branch information
Philzen committed May 1, 2024
1 parent 023bd32 commit ded8dc0
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 40 deletions.
46 changes: 45 additions & 1 deletion .htaccess
Original file line number Diff line number Diff line change
@@ -1 +1,45 @@
ErrorDocument 404 /404.html
ErrorDocument 404 /404.html

<IfModule mod_expires.c>

ExpiresActive on

ExpiresDefault "access plus 1 month"

# JavaScript

ExpiresByType application/javascript "access plus 1 year"
ExpiresByType application/x-javascript "access plus 1 year"
ExpiresByType text/javascript "access plus 1 year"

ExpiresByType text/html "modification"

</IfModule>

<IfModule mod_headers.c>
<filesmatch "\.(css|jpg|jpeg|js|png)$">
Header set Cache-Control "max-age=31536000, public"
</filesmatch>
<filesmatch "\.(html|xml)$">
Header set Cache-Control "no-store, max-age=0"
</filesmatch>
</IfModule>


# ----------------------------------------------------------------------
# ETag removal
# ----------------------------------------------------------------------

# FileETag None is not enough for every server.
<IfModule mod_headers.c>
Header unset ETag
</IfModule>

# Since we're sending far-future expires, we don't need ETags for
# static content.
# developer.yahoo.com/performance/rules.html#etags
FileETag None

<IfModule mod_headers.c>
Header unset Server
</IfModule>
39 changes: 0 additions & 39 deletions assets/js/lib/.htaccess

This file was deleted.

0 comments on commit ded8dc0

Please sign in to comment.