File tree Expand file tree Collapse file tree 5 files changed +35
-0
lines changed Expand file tree Collapse file tree 5 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -331,6 +331,12 @@ class Config extends \Magento\PageCache\Model\Config
331
331
const XML_FASTLY_IMAGE_OPTIMIZATIONS
332
332
= 'system/full_page_cache/fastly/fastly_image_optimization_configuration/image_optimizations ' ;
333
333
334
+ /**
335
+ * XML path to image optimizations flag forced
336
+ */
337
+ const XML_FASTLY_IMAGE_OPTIMIZATIONS_FORCED
338
+ = 'system/full_page_cache/fastly/fastly_image_optimization_configuration/image_optimizations_forced ' ;
339
+
334
340
/**
335
341
* XML path to automatic compression flag
336
342
*/
@@ -828,6 +834,10 @@ public function getGeoIpRedirectMapping()
828
834
*/
829
835
public function isImageOptimizationEnabled ()
830
836
{
837
+ if ($ this ->_scopeConfig ->isSetFlag (self ::XML_FASTLY_IMAGE_OPTIMIZATIONS_FORCED )) {
838
+ return true ;
839
+ }
840
+
831
841
if ($ this ->isFastlyEnabled () !== true ) {
832
842
return false ;
833
843
}
Original file line number Diff line number Diff line change @@ -78,6 +78,10 @@ private function isFastlyImageOptimizationEnabled()
78
78
$ this ->isFastlyEnabled = false ;
79
79
}
80
80
81
+ if ($ this ->_scopeConfig ->isSetFlag (Config::XML_FASTLY_IMAGE_OPTIMIZATIONS_FORCED )) {
82
+ $ this ->isFastlyEnabled = true ;
83
+ }
84
+
81
85
return $ this ->isFastlyEnabled ;
82
86
}
83
87
@@ -100,6 +104,10 @@ public function isForceLossyEnabled()
100
104
$ this ->isForceLossyEnabled = false ;
101
105
}
102
106
107
+ if ($ this ->_scopeConfig ->isSetFlag (Config::XML_FASTLY_IMAGE_OPTIMIZATIONS_FORCED )) {
108
+ $ this ->isFastlyEnabled = true ;
109
+ }
110
+
103
111
return $ this ->isForceLossyEnabled ;
104
112
}
105
113
Original file line number Diff line number Diff line change @@ -182,6 +182,10 @@ private function isFastlyImageOptimizationEnabled()
182
182
$ this ->isFastlyEnabled = false ;
183
183
}
184
184
185
+ if ($ this ->scopeConfig ->isSetFlag (Config::XML_FASTLY_IMAGE_OPTIMIZATIONS_FORCED )) {
186
+ $ this ->isFastlyEnabled = true ;
187
+ }
188
+
185
189
return $ this ->isFastlyEnabled ;
186
190
}
187
191
@@ -204,6 +208,10 @@ public function isForceLossyEnabled()
204
208
$ this ->isForceLossyEnabled = false ;
205
209
}
206
210
211
+ if ($ this ->scopeConfig ->isSetFlag (Config::XML_FASTLY_IMAGE_OPTIMIZATIONS_FORCED )) {
212
+ $ this ->isFastlyEnabled = true ;
213
+ }
214
+
207
215
return $ this ->isForceLossyEnabled ;
208
216
}
209
217
Original file line number Diff line number Diff line change 496
496
target="_blank">image optimization guide</a> for caveats and details.]]> </comment >
497
497
<source_model >Magento\Config\Model\Config\Source\Yesno</source_model >
498
498
</field >
499
+ <!-- ===============================================
500
+ Force Enable Deep Image Optimization select field
501
+ ================================================ -->
502
+ <field id =" image_optimizations_forced" translate =" label comment" type =" select" sortOrder =" 20" showInDefault =" 1" showInWebsite =" 0" showInStore =" 0" >
503
+ <label >Force Enable Deep Image Optimization</label >
504
+ <comment ><![CDATA[ Use this to forcefully enable deep image optimisation on instances that are not connected to fastly, for use on test environments]]> </comment >
505
+ <source_model >Magento\Config\Model\Config\Source\Yesno</source_model >
506
+ </field >
499
507
<!-- ====================================================
500
508
JPEG image quality input field
501
509
===================================================== -->
Original file line number Diff line number Diff line change 45
45
</fastly_blocking >
46
46
<fastly_image_optimization_configuration >
47
47
<image_optimizations >0</image_optimizations >
48
+ <image_optimizations_forced >0</image_optimizations_forced >
48
49
<image_optimization_force_lossy >0</image_optimization_force_lossy >
49
50
<image_optimization_image_quality >80</image_optimization_image_quality >
50
51
<image_optimization_bg_color >1</image_optimization_bg_color >
You can’t perform that action at this time.
0 commit comments