I'd suggest looking at the Deployment Script resource. You can run a PowerShell script as part of the ARM deployment.
Clearing the cache is a data plane operation, that ARM deployments are not typically used for. Deployment Scripts provides a useful workaround to these scenarios. To look at these in action, and what else you can do, see the Bicep Registry (Bicep enhances the ARM authoring experience and compiles to the same ARM JSON)