PrestaCraft on Facebook

Please like our page on Facebook to get notifications about new tutorials :)


PrestaCraft

Tutorials

Today I will show you how to programatically clear cache in PrestaShop. For example, you can make a CRON task which will execute this little PHP script once or more per day – depending on your needs.

1. Create PHP file in your store root (main) directory and name it as you wish – in this example it’ll be cache_clear.php
2. Open this file and paste

3. Change the string vBnmmP3218 to your random one (stronger is more secure).
4. Save the file.
5. Add script URL to your CRON task manager or execute it directly via your browser in format: http://{your_store_url}/cache_clear.php?token=vBnmmP3218

For example: http://example.com/cache_clear.php?token=vBnmmP3218

Comments about this post (1)

Add a comment
Dolors 01-05-2018
Hi, can you tell me which directories exactly delete this code in the Prestashop 1.6 version? Because for example the module that is installed in version 1.6.1.18 does not empty the cache / smarty / compile directory and it is precisely the one that I need to empty due to an inode problem. Thank you very much and greetings

Leave a comment

Your email address will not be published.