My words from my mind
Tag Archives: web
With the web technology advancing so rapidly and information is getting bigger and flowing faster than ever, many web applications nowadays can’t live without constantly checking for new data from the servers.
The most basic form of a websites deals with HTTP request from the webpage to the server. The user send a request in an url form and the server response with the content that was requested. End of story.
Say that you are viewing a page that tell you how many times a jumping sheep has been jumping and it is jumping in average of once every 1 – 10 minutes, you might want to refresh your page every few minutes if it has been jumping or not. But with today’s technology, there should be a way that we get notified whenever the sheep jumps.
The main challenges of getting a direct feedback is that web application usually support a huge amount of users and they could be located anywhere in the world. It is simpler to think that the server just give the information whenever it’s requested. Instead of being busy trying to send updates to every connected clients (if they are connected). However, let’s explore the possible implementations.
The drawback is, page refresh is rarely favourable in the fast moving content packed web applications. By refreshing the page, you will need to refresh other resources needed where we are only interested in a simple integer that tell us if the Sheep has jumped. So, let’s move on.
Ajax Long Pooling
In addition to that, we can set the connection to stay alive until we get a response (or time out). Anyhow, this will still involve the web browser to constantly sending new requests every now and then to get updated. One drawback is that the server might be idle for few hours without any new worthy updates, so the resources used to send those requests might just end up in waste.
Web Sockets / Comet / Probably other terms
lastly we have web sockets. With the web servers and browsers needing more and more frequents interaction, there is finally a way that the server can be event driven instead of request driven only.
Web Sockets allow a more interaction connection where the server can be allowed to send response based on events that happens in the server itself. In this way, the web browser (client) doesn’t have to constantly send request for updates, but simply be event driven as well that only reacts when needed.
This will also reduce the overhead of constant new requests that happen between the client and server.
However, web sockets may cause some compatibility issues depending on the server technologies used and also the browser. But we’ve seen an increasing support for this technologies that allow developers to create more and more responsive applications.
One popular technology that works well with Web Sockets is Node.JS. But there are ways to work around Django through Redis or other library that can provide us with this capability.
No offence Yii, but I’m going to move on. First, your lack of examples in your user manual – where the the manual itself is mediocre to start with – is tolerable. But, I started to wonder if people really use you. For a tool like you, you should be proud if people talk a lot about you, especially best if they talks about the problems they are having with you. At least by then, there will be lots of devoted worshipper that are willing to find the solutions for every problem that people talk about.
I just can’t do it any more. I’m stuck here with a problem that nobody (that I can reach) knows. It all started with one very promising book “Agile Web Application Sevelopment with Yii 1.1 and PHP5” which is really good to start with. But it only take 3 chapters for you to left me bleeding at a corn field near my uncle Jimmy’s house. I’m still bleeding by the way, just so you know. I just can’t figure out how to make the Selenium works without giving me that “Failed opening ‘SiteTest: Firefox.php'”error. I can’t proceed without Selenium, the whole book is about Test-driven approach. And if the testing tools doesn’t work, how to proceed?
There are still plenty of fishes in the sea. Though you are the chosen one and I have to come back to you one day, I think I’ll just forget about you until then.