The success of fog radio access networks (F-RANs) is critically dependent on the potential quality of service (QoS) that they can offer to users in the face of capacity-constrained fronthaul links and limited caches at their remote radio heads (RRHs). In this context, the collaborative beamforming design is very challenging, since it constitutes a large-dimensional nonlinearly constrained optimization problem. The paper develops a new technique for tackling these critical challenges in fog computing. We show that all the associated constraints can be efficiently dealt with maximizing the geometric mean (GM) of the user throughputs (GM-throughput) subject to the affordable total transmit power constraints. To elaborate, the GM-throughput maximization judiciously exploits the fronthaul links and the RRHs' caches by relying on our novel algorithm, which evaluates low-complexity closed-form expressions in each of its iterations. The problem of F-RAN energy-efficiency is also addressed while maintaining the target throughput. Numerical examples are provided for quantifying the efficiency of the proposed algorithms.