Skip to main content

firebase

Cache-Control Headers: In Firebase Hosting, you can configure cache-control headers to specify how long browsers should cache your static assets. For images, a long cache duration is typically fine since they don't change often.

Modify firebase.json: This file in your project directory lets you configure how Firebase Hosting serves your files.

{
"hosting": {
"public": "public",
"headers": [
{
"source": "/images/**",
"headers": [
{
"key": "Cache-Control",
"value": "public, max-age=31536000, immutable"
}
]
}
]
}
}