diff --git a/aio/.gitignore b/aio/.gitignore index 901c8f7359..2eddfb3d9a 100644 --- a/aio/.gitignore +++ b/aio/.gitignore @@ -26,11 +26,13 @@ !.vscode/extensions.json # misc +/.firebase/ /.sass-cache /connect.lock /coverage /libpeerconnection.log debug.log +firebase-debug.log npm-debug.log testem.log /typings diff --git a/aio/firebase.json b/aio/firebase.json index 9699fa2b1a..683e3ea9dd 100644 --- a/aio/firebase.json +++ b/aio/firebase.json @@ -120,12 +120,25 @@ ], "headers": [ { - "source": "/", + // All paths (URLs without a file extension). + "source": "**/!(*.*)", "headers": [ - { - "key": "Link", - "value": ";rel=preload;as=fetch,;rel=preload;as=fetch" - } + {"key": "Cache-Control", "value": "no-cache"}, + {"key": "Link", "value": ";rel=preload;as=fetch,;rel=preload;as=fetch"} + ] + }, + { + // Images, fonts, (non-hashed) CSS/JS files. + "source": "**/*.@(gif|jpg|jpeg|png|svg|webp|js|css|eot|otf|ttf|ttc|woff|woff2)", + "headers": [ + {"key": "Cache-Control", "value": "max-age=86400"} // 1 day + ] + }, + { + // Hashed CSS/JS files... + "source": "**/*.+([0-9a-f]).@(css|js)", + "headers": [ + {"key": "Cache-Control", "value": "max-age=2592000"} // 30 days ] } ]