Skip to content

Commit f2fa5ac

Browse files
committed
fix: Update cache-control headers in Firebase transformer
- 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.
1 parent 18d14c9 commit f2fa5ac

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

transformer-firebase.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module.exports = (headers) => {
2727
headers: [
2828
{
2929
key: 'Cache-Control',
30-
value: 's-maxage=31536000,immutable',
30+
value: 'max-age=31536000,s-maxage=31536000,immutable',
3131
},
3232
],
3333
},
@@ -36,20 +36,11 @@ module.exports = (headers) => {
3636
headers: [
3737
{
3838
key: 'Cache-Control',
39-
value: 's-maxage=31536000,immutable',
39+
value: 'max-age=31536000,s-maxage=31536000,immutable',
4040
},
4141
],
4242
},
4343
...headers,
44-
//{
45-
// source: '**',
46-
// headers: Object.entries({
47-
// ...headers,
48-
// }).map(([key, value]) => ({
49-
// key,
50-
// value,
51-
// })),
52-
//},
5344
],
5445
},
5546
};

0 commit comments

Comments
 (0)