Open alxndr-w opened 2 years ago
$possible_types = rex_server('HTTP_ACCEPT', 'string', '');
$types = explode(',', $possible_types);
if (in_array('image/avif', $types)) {
$subject->setCachePath($subject->getCachePath() . 'avif-');
} elseif (in_array('image/webp', $types)) {
$subject->setCachePath($subject->getCachePath() . 'webp-');
} else {
$subject->setCachePath($subject->getCachePath() . 'jpg-');
}
wie in https://github.com/AndiLeni/media_negotiator/blob/main/boot.php
https://github.com/nucliweb/image-element#use-a-cdn-image-service