From a781062a419854941b09888d11d4d39ca212a16b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Varga?= Date: Mon, 9 Dec 2024 07:54:43 +0100 Subject: [PATCH] fix: Update cache-control headers in Firebase transformer (#83) - Adjusted `Cache-Control` headers in `transformer-firebase.js`: - Added `max-age=31536000` to complement `s-maxage=31536000` and ensure consistent cache behavior across all levels. - Ensures better compatibility and optimized caching for static assets. - Removed commented-out unused code for cleaner and more maintainable configuration. - **Impact**: - Improves caching efficiency for assets by aligning cache-control directives. - Simplifies the Firebase hosting configuration for enhanced clarity. --- transformer-firebase.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/transformer-firebase.js b/transformer-firebase.js index 4f264cb..0179a30 100644 --- a/transformer-firebase.js +++ b/transformer-firebase.js @@ -27,7 +27,7 @@ module.exports = (headers) => { headers: [ { key: 'Cache-Control', - value: 's-maxage=31536000,immutable', + value: 'max-age=31536000,s-maxage=31536000,immutable', }, ], }, @@ -36,20 +36,11 @@ module.exports = (headers) => { headers: [ { key: 'Cache-Control', - value: 's-maxage=31536000,immutable', + value: 'max-age=31536000,s-maxage=31536000,immutable', }, ], }, ...headers, - //{ - // source: '**', - // headers: Object.entries({ - // ...headers, - // }).map(([key, value]) => ({ - // key, - // value, - // })), - //}, ], }, };