Bobcares

How to clear cache in Prestashop manually & from backoffice

by | Oct 22, 2018

“None of my store changes are visible! What’s wrong? Is it Prestashop cache?”

We see support requests like this everyday as part of our Outsourced Tech Support for web hosting providers.

Prestashop store owners would make a change to the code or change the theme, but the site would still show the old content or layout.

What’s going wrong?

Today we’ll take a quick look at the common causes for old cache issue in Prestashop and how our Support Engineers fix them.

 

Where is stale cache of Prestashop found?

We’ve seen primarily three areas where Prestashop stale cache is found.

 

1. Browser

One way to increase site speed is to ask browsers to cache big files like JS, CSS and images for a very long time.

This is done using a server setting called “Expires“. With this, a site owner can ask browsers to store files for a few days or even years.

We’ve seen sites configured to ask browsers to store cache for 6 months.

So, in such sites no amount of browser refresh will show the updated site layout.

 

2. Website folders

This is what we all commonly see and hear about.

Prestashop compiles template files into single easily accessible files, and stores in the Smarty cache folders.

Sometimes, the cache clearing operation from Prestashop backoffice fails, and the old files remain in the cache.

 

3. Web server or web proxies

Some web servers employ caching systems like Varnish and Nginx to improve response times.

Similarly, some site owners use corporate web proxies that cache site content.

In these two cases, no amount of cache clearing on the website will fix the stale cache issue.

 

How to clear cache from Prestashop backoffice

The easiest way to clear cache is using the Prestashop backoffice.

From Prestashop 1.4 onwards, the backoffice has a feature to delete cache files stored by Smarty.

 

Flushing cache in Prestashop 1.4

Login to back-office and go to Preferences –> Performance –> Force compile and choose “Yes“.

This will generate new files and replace the old ones.

Once you’ve seen the new page, set the “Force compile” back to “No“.

 

Flushing cache in Prestashop 1.5

PS 1.5 follows a similar process, just that the settings are in a different place.

Login to admin area and go to  Advanced Parameters –> Performance –> Force compile and choose Yes.

Once you see the new page, change this setting back to “No“.

 

Clearing cache in Prestashop 1.6 and Prestashop 1.7

Login to admin panel, and go to Advanced Parameters –> Performance –> Template compilation” and choose “Force compilation.

Then in Cache choose “NO“.

You can also clear it by clicking on the “Clear Cache” button on right-top corner.

Prestashop clear cache

 

Manually clearing Prestashop cache

Now, we’ve seen cases where this cache clearing from the admin area doesn’t quite work.

In such cases, we delete the cache files from back end.

Here’s how to do it.

 

Deleting cache in Prestashop 1.3 and 1.4

Prestashop 1.3 and 1.4 had similar website files structures. So, the cache files are located in these locations.

Go to these folders and delete all files in them.

  • /tools/smarty/cache
    • OR /tools/smarty_v2/cache
  • /tools/smarty/compile
    • OR  /tools/smarty_v2/compile

 

Deleting cache in Prestashop 1.5, 1.6

Every Prestashop version after 1.4 has the same folder structure.

Go to these folders and delete all files in them..

  • cache/smarty/compile
  • cache/smarty/cache
  • img/tmp

In Prestashop 1.7

Similarly, in version Prestashop 1.7, we clear all folders and files in /var/cache/ directory. Prestashop will regenerate it automatically.

That usually does the trick when we fix this issue for our customers.

 

Still not working? Maybe it’s the server or proxy cache

Despite clearing all the site cache, if you are still seeing old site version, the cache would be in any of these locations:

  • Browser – To check this possibility, try accessing from another browser or by turning on “incognito mode”.
  • Server – The server could be caching the old site version. In such cases, we clear the server cache, and reload the site. If you have root access to the server, you can do it yourself.
  • Proxy – If you are behind a corporate firewall and proxy, you may want to check with your local network administrator.

 

Conclusion

Prestashop showing old site version is a common error we face in our Server Support Services for web hosts. Here we’ve listed down the top 3 causes for Prestashop to show stale cache, and how to fix them.

 

 

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

SEE SERVER ADMIN PLANS

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

6 Comments

  1. John

    In Prestashop 1.7, I need to switch off Twig caching so that I can carry out template modifications without having to clear the entire cache set after each edit.

    There is a Smarty control section in the back office, but nothing for Twig.

    Any ideas?

    Reply
    • Sijin George

      Hello John,
      Disabling Twig caching needs manual modification. Our Prestashop experts can help you. We’ll be happy to talk to you on chat (click on the icon at right-bottom).

      Reply
  2. Josh

    For PS 1.7 it’s not correct. The caches are in /var/cache/. It would be nice if you can correct your article.

    Thanks.

    Reply
    • Sijin George

      Hello Josh,
      Thank you for the tip. Updated the article content.

      Reply
  3. Ricky

    Mine is v 1.6 and i tried above
    none of them is working in my case

    Reply
    • Arya MA

      Hi Ricky,

      Do you still get issues with clearing cache? If you still find problems, we’ll be happy to talk to you on chat (click on the icon at right-bottom).

      Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.