Clear Safari iPhone Cache
To get started head to Settings > Safari.
Next, scroll down to the bottom of the screen and go to Advanced > Website Data.
Now tap Remove all Website data and Remove Now.
This clears out your iPhone cache including browsing history, cookies, location data, and more.
Clear App Cache
This is a more tricky one. Not in its execution, but whether or not you want to do it. Deleting app cache will free up space, but will make the apps behave how they did when first installed. You might need to log in to certain apps again and set them up again, too. The process essentially involves deleting an app outright to clear its data and reinstalling it again. To get started to Settings > General > iPhone Storage and scroll down the list of apps and tap the one you want to clear. Click Delete App and Delete App again to confirm. Now that all the data is gone including the app, you can go back and reinstall it from the Apple App Store. Also, note that there is an option to Offload an app. This gets rid of the app but keeps its cache in place for when you want to install it again.