dev site reverts to production site url when clearing cache
@Clive's suggestion jarred my memory and I figured it out. I have a multisite setup that I was migrating and had the base url setting in settings.php set to www.example.com and I had forgotten to change it to the localhost url. When I commented out the base url setting, everything was fine.