Mirage & RocketLoader Performance Issues

Both Mirage and RocketLoader appear to serve their respective scripts from a Cloudflare domain rather than from our own domain via CDN. The additional SSL handshakes required is causing a noticeable performance hit.

Is this by design?

If so, is there a workaround?

I can’t imagine these tools having a positive performance effect except on sites with the gravest of baseline image/cwv performance.

This was requested twice before

But there’s no workaround at this time if you want Rocket Loader enabled.

Technically, Rocket Loader is just Webpack but for arbitrary scripts and some magic that loads them as if they were in their original positions in the page.

If you can, it would be best practice to instead make sure your scripts work when they’re loaded at the end of the HTML page and move them all to the end of the HTML page (right before the </html> ) .

Eg change

<html>
<head>
<title></title>
<script src="http://example.example/one.js">
<script src="http://example.example/two.js">
</head>
<body>
<p>hello</p>
</body>
</html>

to

<html>
<head>
<title></title>
</head>
<body>
<p>hello</p>
</body>
<script src="http://example.example/one.js">
<script src="http://example.example/two.js">
</html>

This is effectively what Rocket Loader does, however, your scripts might not necessarily work in this situation, and you might have a complex setup that prevents you from moving the scripts further down the page…

1 Like

May I ask where exactly? Which tool have you used and what did you measured so far?
Any other user/visitor reporting the same issue, or that’s just a assumption based on a report from some online tool measuring multiple factors for page load time?

I’d check with a real 3G/4G or slower network mobile phone :wink:

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.