0

我在 Opera 上发现了一个非常酷的功能,它可以在网站上获取数据,它显示较低分辨率的图像和类似的东西,并且页面加载速度很快。这对于慢速连接非常有用。

我对这个小功能的背景很感兴趣,以我对 CSS、HTML 和 Javascript 的基本知识,我不明白如何做到这一点。谁能解释它是如何工作的?

我的意思是说对于图像,它需要先下载图像,然后将其转换为较低分辨率的图像,那么我们在哪里“赢得”时间呢?图片还在下载中吧?

4

2 回答 2

1

Sad to say it's non-trivial for you to achieve what you are trying to do. If you take a look at Opera Turbo

How we squeeze out all that speed

When Opera Turbo is enabled, webpages are compressed via Opera's servers so that they use much less data than the originals. This means that there is less to download, so you can see your webpages more quickly.

Enabling Opera Turbo is as simple as clicking the Opera Turbo icon at the bottom-left of the Opera browser window. When you are on a fast connection again and Opera Turbo is not needed, the Opera browser will automatically disable it.


Your best bet is to follow up on How do I check connection type (WiFi/LAN/WWAN) using HTML5/JavaScript?, depending on their connection type, load your images accordingly, but be aware that, a connection type cannot accurately let you determine their network speed. A device can be on 3G or LTE but still getting crappy speeds from their provider.

If you really want to implement this feature and be safe to work across browsers & devices, i can suggest putting lazyload plugins like Unveil that will help with the amount of data on load. OR include a button within your page that allow the user to select a low bandwidth option, something like what gmail does

for slow connections

于 2014-03-25T08:56:25.127 回答
1

Turbo 模式确实是 Opera 的一大特色。

简而言之,它将完整的代码和图像下载到 Opera 服务器,然后发送给用户。Turbo 模式可节省大量流量(高达 80%)。Opera 然后在响应用户请求的同时即时解压缩数据。好吧,Turbo 模式下的图像几乎没用,但当您使用极慢的互联网速度时,这种模式基本上会派上用场。

您可以查看官方文档以查找更多信息。另外,请查看我写的关于 Turbo 模式的旧帖子。在那里您可以找到有关此主题的更多信息和有用的链接。

此外,在 StackOverflow上查看关于opera-turbotag here的信息。

于 2014-04-26T20:19:57.407 回答