I am using the following script to delete the Safari & Chrome caches upon login. It seems to work but I noticed it doesnt clear the Safari history.
#!/bin/sh #Remove Safari and Chrome Cache sudo -u $3 /bin/rm -rf /Users/$3/Library/Caches/com.apple.Safari sudo -u $3 /bin/rm -rf /Users/$3/Library/Caches/Google/Chrome
Is that set somewhere else?
any chance you have successfully used this on Monterey? Just stumbled across this old post today and was trying to replicate exactly what you have done, but unfortunately nothing seems to happen on my devices and all the cached data persists. Thanks