I have implemented the script but the cache is not working.
Make sure you have included cache script file at the top of your page that you want to cache.
Make sure there is a cache directory in your project with the same name that is defined in the cache script.
Make sure you are using absolute path to the ‘cache directory’ and its correct.
Please read documentation.