This project is not covered by Drupal’s security advisory policy.

When a visitor requests an image at a URL such as /sites/default/files/styles/thumbnail/public/photo.jpg, Drupal can build that resized version the first time it is needed. On busy sites—or when files live on remote storage—that on-demand work slows page loads and increases server and API traffic.

Advanced Image Style Warmer solves that by pre-generating image style derivatives (the resized or cropped files Drupal creates from your originals). You choose, per image style, whether warming happens immediately when a file is saved, in the background via Drupal’s queue and cron, or for existing files through a parallel Drush backfill. A registry in the database remembers which file and style pairs are already warm so workers can skip work without expensive remote “does this file exist?” checks—important for sites with many files and S3 or similar storage.

The module uses Drupal core’s File and Image APIs only; it does not replace your storage module. It is a scalability-focused successor to patterns used by Image Style Warmer, with bundled queue items, FID-range backfill, and registry-aware processing.

Features

What it does

  • Lists every image style on the site and lets you assign Immediate or Queue warming (one mode per style; both cannot be enabled for the same style).
  • On file insert and update (permanent image files only), warms configured styles: synchronous for Immediate, then enqueues a single queue item per file containing all Queue styles for that file.
  • Maintains the advanced_image_style_warmer_registry table: tracks file ID, style name, warmed state, in-queue flag, and timestamp so queue workers and backfill can skip already-warm pairs without relying on file_exists() against remote derivatives.
  • Invalidates registry rows when image styles are flushed or deleted, when files are deleted, or when a file’s URI or size changes (including replace scenarios).
  • Bulk actions: warm selected files; optional action for media image fields when the Media module is enabled.
  • Drush commands for parallel historical warming, status, and inspecting recently warmed URIs.
  • Optional integration with the Crop module: re-warms the backing file when crop entities change.
  • Settings migration from Image Style Warmer if that module is still enabled when you install or run database updates (does not overwrite non-empty new settings).

Why use it

  • Performance: Avoid first-hit image toolkit work on the web request path; warm derivatives ahead of traffic or CDN fetches.
  • Large catalogs: Backfill millions of existing images with FID-range chunks and multiple worker processes, avoiding slow SQL OFFSET pagination.
  • Remote storage: Reduce repeated network existence checks during warming by trusting the local registry after a successful warm.
  • Operational control: Critical styles (hero, card thumbnail) can be Immediate; heavy or secondary breakpoints can be Queue so editors are not blocked.

Example use cases

  • News or commerce sites with large media libraries and many responsive image styles.
  • Sites using S3FS or other remote file systems where derivative existence checks are costly.
  • Migrations or launches where you want derivatives built before go-live traffic.
  • Replacing or outgrowing Image Style Warmer on Drupal 10 or 11 with a registry and parallel backfill.

Post-Installation

  1. Run database updates after enabling (creates the registry table and related schema).

    drush updatedb -y

    drush cr
  2. Configure image styles

    Go to Configuration → Media → Advanced Image Style Warmer

    (/admin/config/media/advanced-image-styles-warmer)

    Requires the Administer image styles permission.

    For each style, choose Immediate or Queue. Settings are stored in advanced_image_style_warmer.settings and are exportable with configuration sync.
  3. Ensure background processing for Queue styles

    Run cron regularly, or manually:

    drush queue:run advanced_image_style_warmer
  4. Warm existing files (one-time or periodic)

    drush aisw:backfill --styles=hero,thumbnail --concurrency=8 --chunk-size=5000

    Monitor with drush aisw:status and drush aisw:latest --style=thumbnail --limit=10
  5. Optional: bulk actions

    Check Structure → Actions (or Views bulk actions) for Warm image styles for files and, if Media is enabled, Warm image styles for media.
  6. Upgrading from Image Style Warmer

    Keep Image Style Warmer enabled during the first updatedb so settings can migrate (initial_image_styles → Immediate, queue_image_styles → Queue). After verifying configuration and a sample backfill, disable and uninstall the old module when ready. Uninstalling the old module does not delete already-generated derivative files.

There is no new content type and no text format changes—only file and image warming and admin configuration.

Additional Requirements

Required

  • Drupal 10 or 11
  • Core modules File and Image
  • PHP 8.1+
  • Symfony Process (symfony/process ^6 or ^7)—declared in the module’s composer.json; typically satisfied in a Composer-managed Drupal site

Strongly recommended

  • Drush 12+ for aisw:backfill, aisw:status, aisw:latest, and queue operations

Optional (not required)

  • Media — bulk warm action for media entities
  • Crop — re-warm when crops change
  • Image Style Warmer — only for automatic settings migration during upgrade

The module uses Drupal’s database queue by default; Redis or other external queue backends are not required.

  • Drush — backfill, status, queue runs, multisite --uri
  • Media — bulk warming for media image fields
  • Crop — re-warm when editorial crops change
  • Your existing remote file integration (for example S3 File System) — warming uses core ImageStyle::createDerivative() with your site’s stream wrappers; this module does not add S3 support itself

Similar projects

Project How Advanced Image Style Warmer differs
Image Style Warmer Direct predecessor. Adds a stateful registry, one queue item per file (all queue styles bundled), parallel FID-range backfill without SQL OFFSET, registry-based skip logic for remote storage, file replace detection, and Drush operational commands. Settings can migrate on install or update.
Core on-demand generation Core still builds derivatives on first HTTP request if missing. This module proactively builds them and tracks state locally.
CDN / external image optimizers External services optimize delivery; this module focuses on Drupal image styles and file_managed derivatives in your Drupal storage layout.

For small libraries on local disk, simpler warming may suffice. For large file counts, remote derivatives, and controlled backfill, this module targets that scale.

Supporting this Module

Development is maintained by Stefanos Chrs. You can support the project by filing issues with clear reproduction steps, contributing patches in the issue queue, or linking sponsorship or consulting details here when available.

Community Documentation

  • See the project README in the repository for installation, Drush options, and troubleshooting.
  • Add links here to DrupalPod demos, blog posts, or video walkthroughs when published.

Drush quick reference (aisw:)

Command Purpose
drush aisw:backfill Parallel warm of existing files by FID ranges
drush aisw:status Per-style warmed, pending, and queued counts from the registry
drush aisw:latest Recent warmed files with source and derivative URIs
drush queue:run advanced_image_style_warmer Process the queue without waiting for cron

Additional information

Permissions: Configuration uses Administer image styles (same as core image style administration).

Multisite: Pass --uri on the backfill master; worker processes inherit it.

License: GPL-2.0-or-later.

Troubleshooting:

  • Backfill cannot find Drush: run from the Composer project root or set DRUSH_COMMAND to vendor/bin/drush.
  • Queue not draining: run cron or drush queue:run advanced_image_style_warmer; confirm at least one style is set to Queue.
  • Low backfill success rate: check logs for channel advanced_image_style_warmer (missing sources, toolkit errors, storage timeouts).

Project information

  • caution Maintenance fixes only
    Considered feature-complete by its maintainers.
  • Project categories: Media
  • Ecosystem: Drupal core
  • Created by stefanoschrs on , updated
  • shield alertThis project is not covered by the security advisory policy.
    Use at your own risk! It may have publicly disclosed vulnerabilities.

Releases