diff --git a/firebase.json b/firebase.json index 39362f55..0af7759d 100644 --- a/firebase.json +++ b/firebase.json @@ -12,9 +12,38 @@ "**/.*", "**/node_modules/**" ], - "rewrites": [ + "headers": [ { "source": "**", + "headers": [ + { + "key": "Cache-Control", + "value": "no-cache" + } + ] + }, + { + "source": "**/*.@(woff2|woff|svg|png|jpg|jpeg|webp|ico)", + "headers": [ + { + "key": "Cache-Control", + "value": "max-age=3600" + } + ] + }, + { + "regex": "^/.+-[A-Za-z0-9_-]{8}\\.(js|css)$", + "headers": [ + { + "key": "Cache-Control", + "value": "public, max-age=31536000, immutable" + } + ] + } + ], + "rewrites": [ + { + "source": "!**/*.@(js|css|map)", "destination": "/index.html" } ] @@ -27,9 +56,38 @@ "**/.*", "**/node_modules/**" ], - "rewrites": [ + "headers": [ { "source": "**", + "headers": [ + { + "key": "Cache-Control", + "value": "no-cache" + } + ] + }, + { + "source": "**/*.@(woff2|woff|svg|png|jpg|jpeg|webp|ico)", + "headers": [ + { + "key": "Cache-Control", + "value": "max-age=3600" + } + ] + }, + { + "regex": "^/.+-[A-Za-z0-9_-]{8}\\.(js|css)$", + "headers": [ + { + "key": "Cache-Control", + "value": "public, max-age=31536000, immutable" + } + ] + } + ], + "rewrites": [ + { + "source": "!**/*.@(js|css|map)", "destination": "/index.html" } ]