DataFirefly Speed Pack — Documentation
Install, configure and operate the page cache, Critical CSS and advanced optimization of Speed Pack on PrestaShop 8 and 9.
DataFirefly Speed Pack bundles full page cache, Critical CSS, asset minification and combination, Delay JS, native lazy loading, resource hints, CDN rewriting, server directives and database cleanup into a single module. This guide covers installation, getting started and every configuration tab.
Requirements and compatibility
- PrestaShop 8.0 to 9.x
- PHP 7.2 to 8.3
- Write access to the cache folder and, for server directives, to the root htaccess file
- Multistore and multilingual supported
Speed Pack complements the DataFirefly Core Web Vitals and WebP AVIF Pro modules: it duplicates neither image conversion nor the optimizations those modules already provide.
Installation
- Upload the archive from Modules > Module Manager > Upload a module, or copy the
datafireflyspeedpackfolder into themodules/directory. - Click Install.
- Open the module configuration. A preload token is generated automatically and shown in the Dashboard tab.
Getting started
For a safe rollout, enable options in this order and check the rendering at each step:
- Enable Page cache only. Browse a category page in a private window: the first load returns the
X-DfSpeedPack-Cache: MISSheader, the reload returnsHIT. - Enable HTML/CSS/JS minification and defer.
- Enable image lazy load (protecting the LCP image, see below).
- Enable Critical CSS then async CSS.
- Enable Delay JS.
- Last, and only after a visual check, enable CSS/JS combination.
Under Advanced Parameters > Performance, disable the native CSS/JS optimization (CCC) and let Speed Pack handle minification and combination. The module detects this conflict and flags it in the Dashboard.
Page cache
The page cache serves cached HTML very early, via the actionDispatcherBefore hook, before the controller is instantiated and before product queries run. The cache key varies by shop, language, currency and device.
Scope
Only guest pages with an empty cart are cached. Logged-in customer and cart detection happens as early as possible via the cookie. No logged-in customer page is ever served from cache.
Cacheable controllers
The controller whitelist (one per line) determines eligible pages: for example index, category, product, cms, manufacturer. Remove a controller to exclude it entirely from the cache.
Exclusions
- URLs: substrings, one per line.
- Cookies: the presence of any of these cookies disables caching.
- User-Agents: excluded agents.
- Ignored URL parameters: tracking parameters (utm, fbclid, gclid…) are stripped from the key to avoid cache fragmentation.
Lifetime and invalidation
Lifetime is configurable (0 = until manual purge). Invalidation is automatic on every product, category, CMS page, manufacturer, supplier or stock change. You can also flush the cache at any time from the dedicated button.
CSS
- Minification of inline and combined CSS.
- Combination of local stylesheets into a single file, with relative path rewriting inside url() rules.
- Async CSS: stylesheets are loaded via preload then onload to eliminate render-blocking CSS.
Critical CSS
Paste your above-the-fold CSS per page type into the dedicated fields. It is injected inline in the head, while the rest loads asynchronously. The * field is the fallback for any page without a specific rule.
Enable async CSS together with Critical CSS to avoid any flash of unstyled content (FOUC).
JavaScript
- Minification of inline and combined JS.
- Combination of local JS files.
- Automatic defer of scripts.
Delay JS
Delay JS postpones script execution until the user’s first interaction (scroll, click, key press, mouse move or touch), with a timed fallback. This is the biggest win on TBT and the mobile score.
- Include only: if set, only scripts containing these keywords are delayed.
- Exclude: keywords of scripts that must never be delayed (e.g. jquery, core).
- Add the
data-df-nodelayattribute to a script tag to exclude it individually.
Media
Native lazy loading adds the loading=lazy and decoding=async attributes to images, and loading=lazy to iframes.
Protect your LCP image (hero visual, first visible image) by adding the data-no-lazy attribute or adding it to the exclusions. Otherwise lazy load can degrade the LCP.
Resource hints
- Preconnect and DNS-prefetch: one URL per line, for third-party domains (fonts, analytics, CDN).
- Preload: in
url|typeformat (e.g./img/hero.webp|image). Possible types: image, font, style, script. Preload your LCP image and critical fonts. - font-display swap: injected into inline font rules to avoid invisible text.
CDN
CDN rewriting replaces the local host of static assets with your CDN domain. Enter the CDN URL, then the included and excluded patterns (regular expressions), one per line. Only local assets matching the included patterns are rewritten.
Server (htaccess)
Speed Pack can write server directives between dedicated markers in the root htaccess file:
- GZIP / Brotli compression
- Browser cache for assets (one year, immutable)
- Connection Keep-Alive
Directives are removed automatically on uninstall. If the file is not writable, a warning is shown.
If your server already enables compression (for example via the web server configuration), there is no need to duplicate it here.
Database
Cleanup removes abandoned carts (without an order, beyond the configured number of days) and their orphan rows, old connections and guests, as well as old search statistics and logs.
Orders are never touched. Still, take a database backup before the first cleanup.
Cache warming
Warming collects URLs from your sitemap then preheats the cache, so your visitors always receive a HIT page.
From the back office
Dashboard tab: click Collect URLs then Warm. A progress bar tracks batch progress.
Via CRON task
Automate collection and warming after each nightly purge. The token is shown in the Dashboard.
curl -s "https://your-shop/module/datafireflyspeedpack/preload?action=collect&token=YOUR_TOKEN"
curl -s "https://your-shop/module/datafireflyspeedpack/preload?action=warm&token=YOUR_TOKEN"
Theme control attributes
data-no-lazy— disables lazy load on an image or iframe (LCP image).data-df-nodelay— excludes a script tag from Delay JS.data-df-nodefer— excludes a script tag from defer.data-df-nooptim— excludes a block or link from minification and combination.
Settings import / export
From the Advanced tab, export all settings as JSON to replicate them on another store, or import an existing file.
Troubleshooting
A page stays MISS
Check that you are browsing as a guest (logged out, empty cart), that the controller is whitelisted, that the URL is not excluded and that no exclusion cookie is present. Employees logged into the back office never receive a cached page.
A layout breaks after enabling combination
Disable CSS/JS combination, or add the offending file to the matching exclusions. Combination is intentionally disabled by default.
Unstyled text on load (FOUC)
Enable or complete the Critical CSS for the affected page, and make sure async CSS is enabled.
A script no longer works with Delay JS
Add its keyword to the Delay JS exclusion list, or the data-df-nodelay attribute on the tag.
Uninstallation
Uninstalling removes the htaccess directives, flushes the caches and deletes the module’s settings and admin tab.