Skip to content

Commit

Permalink
enhance preload media
Browse files Browse the repository at this point in the history
  • Loading branch information
alxndr-w committed Apr 18, 2022
1 parent 922632c commit e75e46e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/speed_up.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ public function show()
$preload_media_config = explode(",", speed_up::getConfig('preload_media'));

foreach ($preload_media_config as $file) {
echo '<link rel="preload" href="'. rex_media::get($file)->getUrl() .'">'.PHP_EOL;
if ($media = rex_media::get($file)) {
echo '<link rel="preload" href="'. $media->getUrl() .'" type="'.$media->getType().'">'.PHP_EOL;
}
}

if (self::getConfig('profile') === "custom") {
Expand Down

0 comments on commit e75e46e

Please sign in to comment.