I told my boss right away, as my treatment would be starting with a bilateral mastectomy and I’d be missing a lot of work. I knew going in and talking to him in person would probably be best, but I was too emotional at the time so I emailed. He was incredibly supportive and helped connect me to the various people I needed to talk to (HR, etc) throughout the process.
As for the staff (I work in education) at my school, I believe I had my principal email everyone and let them know. My kids also went to my school, so I felt it important for everyone to know what was going on. Keeping it private didn’t feel like it would work for me, although I know plenty of people who only told the bare minimum at work and that worked for them. Do what feels best for you!!