
Hoy te mostraré cómo borrar el caché mediante programación en PrestaShop. Por ejemplo, puede realizar una tarea CRON que ejecutará este pequeño script PHP una o más veces al día, según sus necesidades.
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
2. Open this file and paste
include('./config/config.inc.php');
$token = Tools::getValue('token');
if($token == “vBnmmP3218”) {
Tools::clearSmartyCache();
Tools::clearXMLCache();
Media::clearCache();
Tools::generateIndex();
echo “Cache clear ended successfully.”;
} else {
echo “Wrong security token – cache clear failed.”;
}
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
Simple Text
Impactos: 0

Impactos: 0
