+ if (!empty($oembed->type) && $oembed->type != 'error') {
+ DBA::insert('oembed', [
+ 'url' => Strings::normaliseLink($embedurl),
+ 'maxwidth' => $a->videowidth,
+ 'content' => $json_string,
+ 'created' => DateTimeFormat::utcNow()
+ ], true);
+ $cache_ttl = Cache::DAY;
+ } else {
+ $cache_ttl = Cache::FIVE_MINUTES;
+ }
+
+ Cache::set($cache_key, $json_string, $cache_ttl);