While I understand it’s not really the answer to your question, it might give your inspiration on how someone else did it:
Clear W3C Total Cache
While I understand it’s not really the answer to your question, it might give your inspiration on how someone else did it:
Clear W3C Total Cache