Results 21 to 27 of 27
It sounds like you want to add interactivity to web pages, so good starting topics to search would be ajax, jquery and ajax, ajax and php, ajax vs web sockets. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 06-19-2014 #21
FastCGI is reportedly much more scalable than mod-php but I haven't had an opportunity to compare them in a suitably loaded environment. If I was getting to the point I cared and didn't need all the additional features that Apache provides, I'd be considering lighter and more focussed web servers such as nginx and Cherokee instead.
- 06-19-2014 #22
Long polling and similar hacks can give you acceptable performance, but they are complex to code. They are hard to even understand in the first place if you're not already familiar with traditional AJAX and its shortcomings. Resetreset is new at this, so something easier to code and understand is called for.Isaac Kuo, ICQ 29055726 or Yahoo mechdan
- 06-19-2014 #23
- 06-19-2014 #24
- Join Date
- Mar 2013
OK, OK, what I wanted was drop down suggestions for a input box, like Google. Isaac, thanks for looking out for me
As it happens, I *had* a book which gave me the vital data that I need, I had just forgotten about it temporarily. And greg of course, answered my question right back there, about char **environ , so... thanks all of you
What exactly is "long polling"?
- 06-19-2014 #25
The way HTTP requests normally work is that the client sends a request to the server and the server returns data as quickly as it can. So, the web browser sends a request for INDEX.HTML and the web server returns the contents of INDEX.HTML as soon as it can. This works perfectly fine for your task. The client sends the input box data, the server returns with a list of suggestions as quickly as it can.
It's not so good for a chat application, because the client could just be sitting there with no data to send, but someone else sends a message. The server now needs to get this new data to you, but it can't initiate contact. The traditional AJAX solution is for the client to repeatedly send HTTP requests every second or so just in case there is new data to receive. How often does the client poll the server for data? It's a trade-off. Too often, and the server is overwhelmed with requests. Too infrequently, and the client could be waiting a long time before the new text shows up.
Long polling is a hack to solve this problem. The client still sends an HTTP request for data, but the server does not immediately return anything. Instead, it leaves the connection open for some seconds if there's nothing immediately available to send. If someone else sends a chat, then the server can now immediately broadcast that chat text to the client waiting for data. This isn't really how HTTP was originally meant to be used, and it may have some performance issues of its own depending on the specifics of the web server. But mainly, it's more complex for the developer to understand and troubleshoot. Which is fine, for someone experienced. It's not the best way to get started.
Now like I said, for your application this is not an issue. You don't need to use long polling, because you only care about sending data to the client when it explicitly requests data (and you want to send this data ASAP).Isaac Kuo, ICQ 29055726 or Yahoo mechdan
- 06-19-2014 #26
- 06-26-2014 #27
- Join Date
- Mar 2013
Thanks guys, specially Isaac for that long and detailed explanation