fix: fix site unlocalized 404 pages + aggressive Netlify /assets caching (#5399)

This commit is contained in:
Sébastien Lorber 2021-08-20 19:37:20 +02:00 committed by GitHub
parent 0480afc75f
commit 072a5a7e2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 5 deletions

18
website/static/_headers Normal file
View file

@ -0,0 +1,18 @@
# /assets folder contain Webpack processed assets with a file hash
# They are safe for immutable caching, as filename change when content change
/assets/*
cache-control: immutable
/fr/assets/*
cache-control: immutable
/pt-BR/assets/*
cache-control: immutable
/ko/assets/*
cache-control: immutable
/zh-CN/assets/*
cache-control: immutable

View file

@ -19,11 +19,6 @@ https://docusaurus.io/docs/zh-cn/* https://v1.docusaurus.io/docs/zh-cn/:spl
/classic/blog/2020/01/19/docusaurus-2020-recap /classic/blog/2021/01/19/docusaurus-2020-recap
# Redirect each country sub-path to appropriate localized 404 file
# See https://docs.netlify.com/routing/redirects/redirect-options/#custom-404-page-handling
/fr/* /fr/404.html 404
# Redirect Docusaurus v1 blog RSS feed
/blog/feed.xml /blog/rss.xml
@ -31,3 +26,14 @@ https://docusaurus.io/docs/zh-cn/* https://v1.docusaurus.io/docs/zh-cn/:spl
# Feature requests redirects
/feedback/* /feature-requests/:splat 301!
/feature-requests/* /feature-requests 200
# FALLBACK: PUT THIS LAST (rules above are more important)
# Redirect each country sub-path to appropriate localized 404 file
# Note: the 404 won't be served if the path match an existing static file
# Note: useless for /* => Netlify already serve /404.html
# See https://docs.netlify.com/routing/redirects/redirect-options/#custom-404-page-handling
/fr/* /fr/404 404
/pt-BR/* /pt-BR/404 404
/ko/* /ko/404 404
/zh-CN/* /zh-CN/404 404