Clear the PrestaShop cache when your store display is broken

You edited your theme, installed a module or updated PrestaShop, and now the store looks wrong, with missing styles, old text or blocks in the wrong place. Before you hunt for a more serious bug, clear the cache, because PrestaShop keeps compiled versions of your pages that do not always reflect your latest changes.

Why the cache breaks the display

PrestaShop uses the Smarty template engine, which turns your theme's .tpl files into compiled PHP files to speed up page display. The store also caches combined stylesheets and scripts. When you change a file or a module changes, these cached versions can stay in place, and the browser ends up receiving a mix of old and new.

Step 1, rule out your browser cache

Start by making sure the problem does not come from your own browser. Open the store in a private window or on another device. If the display is correct there, clearing your browser cache is all you need. If it is still broken, the problem is on the store side.

Step 2, clear the cache from the back office

Open Advanced Parameters > Performance and click the clear cache button at the top right of the page. PrestaShop deletes its caches and shows a confirmation message. Reload the store and check the display.

Step 3, clear the cache manually

If the back office is unreachable or the button is not enough, connect with FTP or through your host's file manager. On PrestaShop 1.7, 8 and 9, the cache lives in the /var/cache/ folder, with a prod subfolder for the live store and a dev subfolder for debug mode.

The PrestaShop developer documentation states that after editing a .tpl file, you need to delete the contents of the following folder, keeping its index.php file.

/var/cache/prod/smarty/compile/

If the display is still wrong, delete the entire contents of /var/cache/prod/. PrestaShop rebuilds these files on the next page load, so the first page will take a little longer to appear, which is normal.

Only delete the contents of the cache folders, never the /var/ folder itself or neighboring folders such as /var/logs/.

Step 4, check the compilation settings

In the same Performance page, the Smarty section controls template compilation and caching. While you work on your theme, forcing compilation saves you from clearing the cache after every change. Once you are done, go back to the production setting, because recompiling on every request slows the store down for all your visitors.

Step 5, if the display is still broken

A display that stays wrong after a full cache clear is no longer a cache problem. The most common causes are a module that adds a stylesheet clashing with your theme, a theme that does not support your PrestaShop version, or direct edits to theme files that an update overwrote. Our article on finding a conflicting module helps you check the first of these.

Frequently asked questions

Does clearing the cache delete my products or orders?

No. The cache only contains temporary copies of files. Your products, customers and orders are stored in the database, which clearing the cache does not touch.

Should I clear the cache after every module install?

It is not required, but it should be your first move whenever the display changes unexpectedly after an install, an update or a theme edit.

My host also has a cache. Should I clear it?

Yes. If your host or a module adds its own caching layer, such as LiteSpeed or a CDN, clear it as well. Otherwise it can keep serving the old version of your pages even after the PrestaShop cache is cleared.

Is your theme still broken after clearing the cache? Tell us what you see, and a screenshot helps a lot. The diagnosis is free and you get the estimated time and price before you commit to anything.

Request a free diagnosis

Comments

Be the first to comment on this article.

Leave a comment

Your rating *
Loading...
Back to top