Firebase doesn't set cache values

41 views
Skip to first unread message

Nicola Zanon

unread,
Jul 4, 2016, 4:38:34 PM7/4/16
to Firebase Google Group
Hi,

I'm using Firebase to host a progressive web app (it's my personal portfolio) but when I try to modify the values in the firebase.json file for the cache-control my directives get ignored and it always display the default values.

Here's my json file:

{
"database": {
"rules": "database.rules.json"
},
"cleanUrls": true,
"hosting": {
"public": "public"
},
"headers": [{
"source": "**/*.@(eot|otf|ttf|ttc|woff|font.css)",
"headers": [{
"key": "Access-Control-Allow-Origin",
"value": "*"
}]
}, {
"source": "**/*.@(jpg|jpeg|gif|png|svg|woff|eot|ttf|css|js)",
"headers": [{
"key": "Cache-Control",
"value": "max-age=2500000"
}]
}, {
"source": "404.html",
"headers": [{
"key": "Cache-Control",
"value": "max-age=300"
}]
}]
}

This is the website: https://nicola-zanon.com/

Any help would be appreciated.
Thanks in advance,

Michael Bleigh

unread,
Jul 6, 2016, 1:26:02 PM7/6/16
to Firebase Google Group
You'll need to move the headers key inside the hosting key and you should be all set :)

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/9fc7a010-aeca-4fef-9370-7580e386e6f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages