How to clear cache in Prestashop manually & from backoffice
“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 Hosting Support Engineers fix them.
Where is stale cache of Prestashop found?
We’ve seen primarily three areas where Prestashop stale cache is found.
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.
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.
- OR /tools/smarty_v2/cache
- OR /tools/smarty_v2/compile
Deleting cache in Prestashop 1.5, 1.6 and 1.7
Every Prestashop version after 1.4 has the same folder structure.
Go to these folders and delete all files in them..
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.
Prestashop showing old site version is a common error we face in our Outsourced 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.