Commit 15a114e
committed
Media: Cache the results of _wp_image_editor_choose.
This saves the `WP_Image_Editor` implementation that supports the queried options to a cache to avoid performing redundant compatibility checks, which can be expensive. For example, `WP_Image_Editor_Imagick::supports_mime_type()` can get called in the editor multiple times to determine which image formats can be supported during `wp_plupload_default_settings()`.
With this cache, the support will be stored for 1 day, speeding up loading times for the editor. This also introduces a new global caching group, `image_editor` to manage any subsequent caches that are related to image editor optimizations.
Props joemcgill, desrosj, westonruter, flixos90, adamsilverstein, mukesh27, joehoyle.
Fixes #61532.
git-svn-id: https://develop.svn.wordpress.org/trunk@59189 602fd350-edb4-49c9-b593-d223f7449a821 parent 4c1898d commit 15a114e
3 files changed
+27
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
876 | 876 | | |
877 | 877 | | |
878 | 878 | | |
| 879 | + | |
879 | 880 | | |
880 | 881 | | |
881 | 882 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4191 | 4191 | | |
4192 | 4192 | | |
4193 | 4193 | | |
4194 | | - | |
| 4194 | + | |
| 4195 | + | |
| 4196 | + | |
| 4197 | + | |
| 4198 | + | |
| 4199 | + | |
| 4200 | + | |
| 4201 | + | |
| 4202 | + | |
| 4203 | + | |
| 4204 | + | |
| 4205 | + | |
| 4206 | + | |
| 4207 | + | |
| 4208 | + | |
| 4209 | + | |
4195 | 4210 | | |
4196 | 4211 | | |
4197 | 4212 | | |
| |||
4225 | 4240 | | |
4226 | 4241 | | |
4227 | 4242 | | |
4228 | | - | |
| 4243 | + | |
4229 | 4244 | | |
4230 | 4245 | | |
4231 | 4246 | | |
4232 | 4247 | | |
4233 | | - | |
| 4248 | + | |
| 4249 | + | |
4234 | 4250 | | |
4235 | 4251 | | |
4236 | | - | |
| 4252 | + | |
| 4253 | + | |
| 4254 | + | |
| 4255 | + | |
| 4256 | + | |
4237 | 4257 | | |
4238 | 4258 | | |
4239 | 4259 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
554 | 554 | | |
555 | 555 | | |
556 | 556 | | |
| 557 | + | |
557 | 558 | | |
558 | 559 | | |
559 | 560 | | |
| |||
648 | 649 | | |
649 | 650 | | |
650 | 651 | | |
| 652 | + | |
651 | 653 | | |
652 | 654 | | |
653 | 655 | | |
| |||
0 commit comments