DataFirefly Cache Clear
Install and use the DataFirefly "Clear cache" button in the PrestaShop 8 and 9 back-office.
Overview
DataFirefly Cache Clear adds a “Clear cache” button to the PrestaShop back-office toolbar. One click purges the Smarty, XML, Media and Symfony caches, resets the PHP OPcache and flushes the object cache if enabled, without going through Advanced Parameters > Performance and without reloading the page.
Installation
- Download the
dfclearcache.ziparchive from your DataFirefly account. - In the back-office, open Modules > Module Manager.
- Click Upload a module and select the ZIP.
- The module installs and enables automatically.
No configuration required: as soon as it is enabled, the button appears in the toolbar of every admin page.
Updating from 1.0.x
Upload the 1.1.0 ZIP in Modules > Module Manager, over the installed version. The upgrade script resets OPcache so the new code is used immediately. Nothing needs to be reconfigured.
Usage
- Click the “Clear cache” button in the toolbar, next to the page actions and the help button.
- The icon spins during the operation. The purge runs over AJAX and the page is not reloaded.
- A green notification confirms the operation and lists the caches cleared, for example “Cache cleared successfully. (Smarty, XML, Media, Symfony, OPcache)”.
What gets cleared
- the Smarty cache (compiled front-office and back-office templates);
- the XML cache;
- the media cache (combined and minified CSS/JS);
- the PrestaShop 8/9 Symfony cache;
- the PHP OPcache, if the extension is active and the host allows it to be reset;
- the object cache (Memcached, APCu), only if it is enabled in Advanced Parameters > Performance.
The Symfony cache is cleared by PrestaShop’s native mechanism at the end of the request. If that mechanism is not available, the module renames the current environment’s var/cache directory, then deletes it once the response has been sent. The directory is never deleted while a page is using it.
Who sees the button
The button is only shown to employees whose profile has access to the module: super administrators and the profile of the employee who installed the module. Other profiles do not see it, which avoids a button that would fail when clicked.
Purge log
Every purge is recorded in Advanced Parameters > Logs with the employee ID, as “DataFirefly Cache Clear: cache cleared (Smarty, XML, Media, Symfony, OPcache)”. A partial purge appears with a “warning” severity.
Compatibility
- PrestaShop 8.0 to 9.x
- PHP 7.4 to 8.x
- Single-store and multistore
- Languages: FR, EN, ES, DE, IT, NL, PL, PT (English by default)
- Hook used:
displayBackOfficeHeader
Troubleshooting
The button does not appear
Check that the module is enabled in the Module Manager and that your profile is one of those with access to the module (see “Who sees the button”).
“Your session has expired” message
Your back-office session expired while the page was open. Reload the page, log in again if needed, then click again.
“Cache partially cleared” message
One step failed and the others ran. The error details appear in the browser console (F12) and the purge is logged as a warning. The most common cause is a write permission problem on the cache directories.
OPcache is missing from the notification
The OPcache extension is disabled, or the host restricts opcache_reset() (opcache.restrict_api directive). The step is then skipped without error. This is not a module malfunction.