Code to clear cache

is there an extension to clear the cache automatically please?
I found the extension ‘clearcacheextend’ but using this extension generates the following error

Oops, an error occurred!

No class named EXT:clearcacheextend/class.tx_clearcacheextend.php:&tx_clearcacheextend

More information regarding this error might be available online.

thank you

First question: WHY do you need this in general. Please describe your use case.

TYPO3 flushes caches after a configurable lifetime anyways and optimizes this per page also. On top of that you can configure the cache’s life time even per page in the page properties.
Maybe this is already enough for your case?

Thank you for your response.
Yes, your answer may help me but I can’t find where exactly I can set up each page. Can you please give me more details?