How to Clear Cache automatically in local browser and electron app?

How to Clear Cache automatically in local browser and electron app?