Prostate cancer and any cancer for that matter is very complex. There is not a single cause. There are things that make it more likely to get prostate cancer. There are fairly recent studies that show men who ejaculate more frequently than average are less likely to get prostate cancer.
The best information available points to a primary cause of prostate cancer being excess estrogen. Men and women both need estrogen, but men need less. Our current environment and our food chain are full of unnatural estrogenic substances, that promote the increase of prostate cancer in men and Breast Cancer
in women. Pesticides and plastics contain estrogenic substances. Most all conventionally raised beef have estrogen implants to speed up weight gain. There is a significant debate as to whether the phytoestrogens found in soy products are harmful or helpful. We have bred our dairy cows to be more and more estrogenic over the past 75 years in particular, leading to higher and higher levels of estrogen in dairy products.
Another correlated factor (not necessarily causal) is zinc levels. High zinc levels are correlated with higher levels of prostate cancer as are low levels. Balance is the key. Semen is high in zinc. Think that through. Perhaps if you ejaculate infrequently, you will have high levels of zinc, particurly if you eat zinc rich foods. Perhaps if you ejaculate a lot, you will have low zinc levels, particularly if you eat few zinc rich foods. Perhaps balance is good. The studies show that on average, men who ejaculate the most are less prone to prostate cancer. That suggests that the average American male is not ejaculating frequently enough. What is the right frequency? I dunno. I suspect it is several times each week. The studies that I have read suggest that 4-7 times a week is in the good range, but I wouldn't hang my hat on it...
I suspect you will need to figure out what is best for you as an individual.