Changing the path of .jekyll-cache folder

Is there a way to change the path of .jekyll-cache folder ?

Yes. Just define cache_dir in your config file accordingly. The only requirement is that the directory be within the site’s configured source directory.