Visitar URL original
cache option doesn't work in 11ty --dryrun · Issue #282 · 11ty/image · GitHub
Skip to content

cache option doesn't work in 11ty --dryrun #282

Open

Description

@murtuzaalisurti
  • run 11ty in dry mode (skips writing files)
  • images are still processed even if cache duration is specified as 2w

still unclear if it actually re-fetches the files or just logs

eleventyConfig.addPlugin(eleventyImageTransformPlugin, {
        formats: ["avif", "webp", "png", "jpeg"],
        cacheOptions: {
            duration: "2w",
        },
    });
Image

Activity

  1. murtuzaalisurti commented on Feb 15, 2025

    @murtuzaalisurti
    Author

    here's a workaround I used:

    /** @param {(import("@11ty/eleventy").UserConfig)} eleventyConfig */
    export default function (eleventyConfig) {
        const dryRun = process.argv.includes("--dryrun"); // this
    
        // ...
        eleventyConfig.addPlugin(eleventyImageTransformPlugin, {
            formats: ["avif", "webp", "png", "jpeg"],
            cacheOptions: {
                duration: "2w",
            },
            statsOnly: dryRun,
        });
    }

    detect if 11ty is running in dry mode or not using process args and use the statsOnly option of eleventy-image to skip file processing.

  2. added theissue type on Jul 24, 2026
  3. self-assigned this
    on Jul 24, 2026
  4. zachleat commented on Jul 24, 2026

    @zachleat
    Member

    On hold until 11ty/buildawesome#4325 ships (with Core v4.0.0-alpha.11)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions