-
Notifications
You must be signed in to change notification settings - Fork 8
Closed
Description
We've ascertained that fetching the HTML for the web informer widget causes around 300ms of lag on the initial server response - pushing us into a non-pass on Core Web Vitals. I'd like to reduce that lag if possible but we can't cache the HTML, for reasons.
Currently the code to fetch this HTML is:
if (!gps('txpreview')) {
$opts = array('http' => array('timeout' => 1.6));
$url = 'https://website.informer.com/widget/textpattern.com-2';
$context = stream_context_create($opts);
$widget = file_get_contents($url, false, $context);
if ($widget) {
echo $widget;
}
}I'm wondering if there is any performance gain from using stream_copy_to_stream instead of file_get_contents?
@Bloke what do you think, and if so can you give me a pointer on the code needed?
Metadata
Metadata
Assignees
Labels
No labels