Smarty Cache in PrestaShop — Don’t Make This Mistake!

For some reason, Smarty cache in PrestaShop is still a subject of debate among developers working with this system. Over many years of working with PrestaShop, I’ve come across various opinions on how it should be configured.

As a reminder, in Advanced → Performance → Smarty settings → Template compilation (for PrestaShop 8.2), we have three options:

  1. Never recompile template files.

  2. Recompile templates if the files have been updated.

  3. Force compilation.

Out of these three, the second option — recompiling templates when their files have changed — is often recommended. Why? Honestly, no one knows for sure. I’ve heard arguments that when changes are made in the back office, product prices or information might not refresh properly on the storefront. But that’s simply not true. Any modification event, such as editing a product or category, should trigger cache clearing for the relevant modules — for example, the Featured Products module on the homepage.

The purpose of this article is to clearly state that on a production site, there is absolutely no reason to use any option other than “Never recompile template files.” Any other setting will only make your store less efficient. Of course, things are different in a test or development environment.

I’d also add that in some specific situations, monitoring template files for modifications can drastically slow down the front office loading time. I’ve seen this happen while consulting on module implementations from certain companies working with PrestaShop.

Of course, also make sure that caching itself is enabled. There, it’s worth setting the option to “Clear cache every time something has been modified”, because otherwise, changes made in the back office won’t actually be visible to visitors. (Yes, I’m aware that sometimes it makes sense to clear the cache only on demand — especially in high-traffic stores where cache management is handled differently. :-))

0
Subscribe to my newsletter

Read articles from Krystian Podemski directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Krystian Podemski
Krystian Podemski

🛠️ Tech Evangelist at @PrestaShop • Core Maintainer • Communication • Public speaking • Technical Marketing 🚀 15+ years in e-commerce • Led dozens of successful PrestaShop projects 🧭 impSolutions agency founder • Experts in PrestaShop development🎤 Public speaker • Passionate about community building and OSS 💬 Ask me anything PrestaShop – code, strategy, or project direction