Skip to content

[6.x] Cache image extension support lookups - #15449

Merged
jasonvarga merged 3 commits into
statamic:6.xfrom
daun:perf/imagick-check-memo
Sep 14, 2026
Merged

jasonvarga merged 3 commits into
statamic:6.xfrom
daun:perf/imagick-check-memo

Conversation

@daun

@daun daun commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

ImageValidator::isValidExtension() calls the image driver on every url, which adds up on image-heavy sites.

The proposed fix in this PR is to cache results by driver class and lowercased extension. This wasn't an issue in 5.x because the lookup there was over a simple array, not via the driver itself. We managed to shave off 700ms from an image-heavy page with this change.

@jasonvarga
jasonvarga merged commit fdc92b7 into statamic:6.x Sep 14, 2026
62 checks passed
@daun
daun deleted the perf/imagick-check-memo branch September 14, 2026 22:52
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.

2 participants