Website with online and offline server?

Hi everyone!

So I’ve googled as much as I could and couldn’t find any answers.

Im currently working on a website for my company and I live in a country where the internet can be a bit dodgy. I was wondering if I could have a cloud based server that constantly synchronizes with a server in the office so we can easily switch when the internet is down and still have all the files uploaded to the cloud.

I’m new to this so forgive me if its a stupid question!