Lol, that won't work because there are way too many file to clear the cache which times out PHP...
I've been clearing the cache via an SSH bash script:
#!/bin/bash
echo "Running clear command"
rm -rf /home/<complete directory to your blog/>/blog/wp-content/cache/*
echo "Cleared"
and replace "<complete directory to your blog>" with the exact directory, i.e. /home/myusername/http/wp-content/cache/*
Few shared hosts give you access to the command line though.
(FYI - Running a bash script via PHP, although possible, will likely fail too)
GL.