Knowledge Base

How to clear the Smarty cache in PrestaShop

PrestaShop themes use the Smarty PHP template engine. If you make modifications to a theme, you may have to clear the Smarty cache to see the changes.

This article describes two methods for clearing the Smarty cache in PrestaShop.

Method #1: Using the PrestaShop administration interface

You can use the PrestaShop administration interface to clear the Smarty cache. To do this, follow these steps:

  1. Log in to PrestaShop as the administrator.
  2. On the left-side menu bar, click ADVANCED PARAMETERS, and then click Performance.
  3. In the SMARTY section, under Template compilation, click Force compilation.
  4. Under Cache, click NO.
  5. Click Save, and then refresh the pages you want to view. You should see any new changes.
    After you are done, make sure you re-enable Smarty caching to take advantage of its performance benefits. For more information, please see this article.

Method #2: Using the command line or cPanel

You can clear the Smarty cache manually using the command line or cPanel's File Manager. This method is useful if the PrestaShop administration interface is inaccessible for some reason. To do this, follow these steps:

  1. Log in to your account using SSH or cPanel.
  2. Navigate to the public_html directory.
  3. In the directory where you installed PrestaShop, delete all of the content in the following directories except for the index.php file:
    • img/tmp
    • cache/smarty/cache
    • cache/smarty/compile
  4. Refresh the pages you want to view. You should see any new changes.