Skip to content

feat: defer eager generation of @Nx srcset variants until render - #296

Merged
marcoluzi merged 1 commit into
mainfrom
feat/defer-eager-generation
Sep 18, 2026
Merged

marcoluzi merged 1 commit into
mainfrom
feat/defer-eager-generation

Conversation

@marcoluzi

@marcoluzi marcoluzi commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds an opt-in defer_generation config key (bool, default false) that stops WordPress from eagerly generating Sproutset's @Nx retina srcset variants at upload, letting the existing on-demand path produce them lazily at render instead. Eager generation of the full roster (30+ Imagick passes off one large source) can exhaust PHP's max_execution_time, most visibly on batch imports looping media_handle_sideload().

Every size's base entry stays eager, so a size always has a real intermediate file after upload and the front end never falls back to the full-size original; only the widest, most expensive @Nx variants are deferred. Default off — current behavior is a guaranteed no-op until a project opts in.

Spec: specs/defer-generation.md. Covered by unit and integration tests.

Checklist

  • PR title follows Conventional Commits (feat:, fix:, refactor:, perf:, revert:)
  • Changes are focused on a single concern
  • I have tested these changes

@marcoluzi
marcoluzi merged commit ca96b26 into main Sep 18, 2026
5 checks passed
@marcoluzi
marcoluzi deleted the feat/defer-eager-generation branch September 18, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant