How to put a FIREBASE HOSTING site into maintenance mode?

Viewed 3083

I have a Vue.js app and use Firebase Hosting to serve the static files to users.

Does Firebase Hosting have a method for putting the app into maintenance mode remotely? Without having to do firebase deploy

Maybe something that will allow me to redirect all the traffic to some other index.html, and be able to manage it from Firebase.

P.S. I've already looked into Firebase Remote Config (and it doesn't fit my use case, and their web related tools aren't fully implemented yet). And I'd like to avoid having a realtime database just for maintenance mode.

2 Answers

There is no mode-switch built into Firebase Hosting for temporarily serving other content.

But given the recent updates to deploy efficiency, it should be pretty low-cost to put up a temporary index.html while making the changes. Alternatively, you could deploy rules (in firebase.json) that temporarily redirect all traffic to a wip.html (for work-in-progress).

Which of these works best, depends on your current content structure. I.e. if you already redirect "all" traffic to index.html, I'd probably go with a rewriting solution.

You can also unroll your last deploy in one command.

  1. Deploy maintenance page
  2. Unroll when its done

Don't forget to send a 503 error for googlebot, asking it to come back in X hours.

Related