Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
462 views
in Technique[技术] by (71.8m points)

How can Opera-mini runs javascript only in the server instead the device?

I read that Opera mini browser can run JavaScript only in server (the code isn't run in the client, it's gets it results from the server) in a newspaper.

I am writing online games and my boss want me do the same thing, but I spent hours and found nothing.

Anyone know how to do it?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Seems that you (or your boss) misunderstood how this works. As explained here, what opera mini do is using a proxy server that executes and compress the javascript code and returns the results to the device.

Requests from the user's handset pass through the carrier's internet gateway on their way to Opera's transcoding servers. These servers then forward the request to the server.

What does this means? In a nutshell, developers just need to write their JS taking in account the limitations of Opera proxies so it can benefit from this. Other mobile browsers don't have this behavior (RIM do some optimization but I'm not sure if it's about JS) and normally, JS is mostly run by client (just think about the browser wars about who has the faster JS engine).

The server is not run by developers/users but Opera as said in the FAQ:

In more detail: When you request a page in Opera Mini, the request is sent to the Opera Mini server that then downloads the page from the Internet. The server then wraps up your page up in a neat little compressed package (we call the format OBML), ready to send back to your phone at the speed of ninjas with jetpacks.

By using Opera Mini, our servers do most of the work, so it works well with less- capable phones. Pages are often smaller (saving you money) and faster to load due our server-side compression.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...