Firebase
created in 2011, acquired by Google in 2014. https://firebase.google.com/docs/storage/faqs-storage-changes-announced-sept-2024?hl=en&authuser=0
Firestoreβ
update CLI toolsβ
npm install -g firebase-tools
.firebaserc contains what project to connect to and similar configurations
firebase.jsonβ
tells firebase what steps to run, what files to include when you run βfirebase deployβ for example
This is crucial for Angular's routing. It ensures that all requests are directed to index.html, allowing Angular to handle routing client-side.d) Headers:
"rewrites": [
{
"source": ""
}
]
This sets caching rules. Dynamic content isn't cached, while static assets (images, styles, etc.) are cached for a week.
"headers": [
{
"source": "/<strong>",
"headers": [
{
"key": "Cache-Control",
"value": "no-cache, no-store, must-revalidate"
}
]
},
{
"source": "</strong>/*.@(jpg|jpeg|gif|png|svg|webp|js|css|eot|otf|ttf|ttc|woff|woff2|font.css)",
"headers": [
{
"key": "Cache-Control",
"value": "max-age=604800"
}
]
}
]
Storageβ
image compression?β
Image Optimization: Consider adding an image optimization step in your build process, especially if you're using Firebase Storage for images. You could use tools like ImageMagick or Sharp as part of your build pipeline.
multisitesβ
https://firebase.google.com/docs/hosting/multisites
firebase init
firebase hosting:sites:create install
firebase target:apply hosting install ApplianceRepair101-13105
firebase deploy --only hosting:install
https://hackernoon.com/deploying-frontend-applications-the-fun-way-bc3f69e15331