Add flag to force enable DIO regardless of the full page cache settings
Hello
I would like to propose an additional flag, which would allow me to enable the image optimisation settings regardless of what page cache has been configured.
My use case is as follows
We have local and ephemeral test environments spinning up for automated and manual QA. They are using a docker varnish container for full page cache rather than hooking into fastly, as this is a "good enough" measure for these temporary environments.
I want those projects and setups to have a proper look and feel, i want images to be rendered correctly at the correct sizes and compressions, to achieve this I want to do the following configuration
- Set up the projects to have varnish for FPC
- Set the project
web/secure/base_media_url=https://example.com/media/so that we can load the production media on this test instance - Forcefully enable fastly DIO by setting
system/full_page_cache/fastly/fastly_image_optimization_configuration/image_optimizations_forced=1, so that we can have all the appropriate resizing and compression parameters attached to the media URLs
This will give us an instance with reasonable FPC, and a good representation of the production media. This covers 99% of our test use cases, the main caveat being that anything that needs to actually test uploading images won't work. But that's an acceptable caveat I believe.
Please let me know if you would like to discuss further, I would have used a plugin to customise this on our instances but the private function isFastlyImageOptimizationEnabled() prevents me from doing so.
Thanks