lampstax Posted September 19, 2008 Share Posted September 19, 2008 I m working on a new project, and normally I would just jump in and start coding, but since this site will take quite a bit of work to create, I want to make sure at least the foundation is solid. As always, any advice is appreciated. I have been coding PHP for a while but unfortunately being self taught, I probably missed out on a few important topics covered in computer science class. That said, The website is going to have to make use of heavy AJAX. Almost a pure AJAX front end like Google Docs. I have setup my own `framework` using Cache_Lite, Smarty, XAJAX, and a custom PDO wrapper for db access all nicely in `MVC` architecture. It works .. fairly well .. but I'm not 100% sold on XAJAX. I've seen sputter performance from it from a previous client website that hit around 100k concurrent user, but that might be because the client was pushing his hardware a bit too. Any thought or suggestion for a more scalable or faster AJAX PHP library ? Secondly, I am a bit concerned with how the site might scale. Lets assume six, seven digit concurrent user level. Would a main stream framework be preferable to home grown in term of speed, security, and expandability ? There's a couple more misc issues, but these are the big two. Would welcome any thought, experience, horror stories, or success stories. Does most ( or all ) successful start up have to eventually switch over the an `big` frame work like Zend or CI or Cake ? What are you experiences ? Quote Link to comment https://forums.phpfreaks.com/topic/124905-best-ajax-friendly-framework/ Share on other sites More sharing options...
448191 Posted September 19, 2008 Share Posted September 19, 2008 With a fully Ajax enabled application, your primary concern is concurrency. Foremost, you just need a fast server with a fast connection. Forming the response is secondarily, and I do not think it matters too much which framework you use. After the initial payload of JS, all that is left is small bits and pieces of data. Forming a response should be possible within 0.2 seconds, which would leave you 0.3 for network latency without the user getting annoyed. That should be easily possible with any current framework (except maybe Symfony), as long as you don't do too intensive stuff in these tiny requests. With these type of applications, you usually have a large payload of JS initially. You have some options to reduce the cost of this: 1) Use a lightweight server to serve up static files 2) Try to ensure client side caching 3) Consider Gzip 4) Consider loading parts dynamically (only if it's REALLY big) It's worth noting that IE 6 doesn't cache Gzipped JavaScript files, so depending on you public, you may want to forget about Gzip. Loading parts of the JS library dynamically is not as complicated as it sounds. It's sort of like require in PHP. The requests gives some indication that some JS is needed, it is included in the response and made executable with eval(). That's it. Only worth it if you have a REALLY big application, with lots of optional library files that may or may not be used during the visitors session. Remember to send an appropriate caching header when you're sending just JavaScript. Only experience with something similar is an application using ExtJs and Zend Framework. Bottleneck in that was indeed the initial payload, and the heavy processing client side. It was really heavy on FF2 and Vista. It was decent in IE6 and 7, FF3 and Safari though. In fact it was lightning fast in Safari. Quote Link to comment https://forums.phpfreaks.com/topic/124905-best-ajax-friendly-framework/#findComment-645438 Share on other sites More sharing options...
lampstax Posted September 22, 2008 Author Share Posted September 22, 2008 448191 .. thanks man .. will look more into caching js client side .. I guess now i'll have to move from AJAX tinkerer to actual AJAX widget maker doode .. urg .. too much to learn .. not enough time .. lol Quote Link to comment https://forums.phpfreaks.com/topic/124905-best-ajax-friendly-framework/#findComment-648122 Share on other sites More sharing options...
CroNiX Posted September 22, 2008 Share Posted September 22, 2008 For the javascript framework, if you want to use one, I suggest using google cache. http://code.google.com/apis/ajaxlibs/documentation/ They already have the major frameworks there (jquery, prototype, mootools, dojo) and they are already compressed/gzipped and support versioning. Then they also have plenty of bandwidth to serve. The major advantage of this is once more and more people use google cache, the chances get better that someone already has googles jquery (for example) already in their cache from a different site they visited and so they client browser doesn't have to download it again for your site making it load very fast. If they don't it downloads it using googles bandwidth, not yours. Win-Win! Quote Link to comment https://forums.phpfreaks.com/topic/124905-best-ajax-friendly-framework/#findComment-648217 Share on other sites More sharing options...
Liquid Fire Posted September 23, 2008 Share Posted September 23, 2008 For the javascript framework, if you want to use one, I suggest using google cache. http://code.google.com/apis/ajaxlibs/documentation/ They already have the major frameworks there (jquery, prototype, mootools, dojo) and they are already compressed/gzipped and support versioning. Then they also have plenty of bandwidth to serve. The major advantage of this is once more and more people use google cache, the chances get better that someone already has googles jquery (for example) already in their cache from a different site they visited and so they client browser doesn't have to download it again for your site making it load very fast. If they don't it downloads it using googles bandwidth, not yours. Win-Win! I would only do this if you are sure you are always going to be able to use googles version that they store because form what i see they only store the latest stable version so if jquery comes out with 1.2.7 and it break a plug-in, you will need that plug-in to be fixed. Quote Link to comment https://forums.phpfreaks.com/topic/124905-best-ajax-friendly-framework/#findComment-648326 Share on other sites More sharing options...
CroNiX Posted September 23, 2008 Share Posted September 23, 2008 They have the earlier versions and you can specify by version. Quote Link to comment https://forums.phpfreaks.com/topic/124905-best-ajax-friendly-framework/#findComment-648331 Share on other sites More sharing options...
lampstax Posted September 23, 2008 Author Share Posted September 23, 2008 Thanks for the suggestion. This sounds like such a brilliantly simple idea! Download once, power the entire web. Chalk another one up to Google. Quote Link to comment https://forums.phpfreaks.com/topic/124905-best-ajax-friendly-framework/#findComment-648454 Share on other sites More sharing options...
Xeoncross Posted September 25, 2008 Share Posted September 25, 2008 If you will use ajax to power the site then the only thing you really need is a framework with a lot of libraries for you to use and a very, very small "core" to load in order to power the system. The "core" are the files loaded when the system is first started up - before you actually do anything. Since you will receive lots more AJAX requests than someone running a site using plain HTTP, you will need a faster framework - or more powerful server to make up the difference. Benchmark the frameworks before you start using them. Quote Link to comment https://forums.phpfreaks.com/topic/124905-best-ajax-friendly-framework/#findComment-650483 Share on other sites More sharing options...
aniesh82 Posted September 26, 2008 Share Posted September 26, 2008 Sorry for saying, I didn't see any suggestion of Good Ajax Frameworks here!! Quote Link to comment https://forums.phpfreaks.com/topic/124905-best-ajax-friendly-framework/#findComment-651147 Share on other sites More sharing options...
448191 Posted September 26, 2008 Share Posted September 26, 2008 Sorry for saying, I didn't see any suggestion of Good Ajax Frameworks here!! Maybe because that's not what the OP is asking. Quote Link to comment https://forums.phpfreaks.com/topic/124905-best-ajax-friendly-framework/#findComment-651148 Share on other sites More sharing options...
aniesh82 Posted September 26, 2008 Share Posted September 26, 2008 Here are the list of Ajax Frameworks: http://en.wikipedia.org/wiki/List_of_Ajax_frameworks Quote Link to comment https://forums.phpfreaks.com/topic/124905-best-ajax-friendly-framework/#findComment-651150 Share on other sites More sharing options...
aniesh82 Posted September 26, 2008 Share Posted September 26, 2008 Maybe because that's not what the OP is asking. Yes you are correct.. But the title of the post says so. thats why I read this topic....And I only searched for the list .. Quote Link to comment https://forums.phpfreaks.com/topic/124905-best-ajax-friendly-framework/#findComment-651151 Share on other sites More sharing options...
448191 Posted September 26, 2008 Share Posted September 26, 2008 Maybe because that's not what the OP is asking. Yes you are correct.. But the title of the post says so. thats why I read this topic....And I only searched for the list .. No, it says best Ajax friendly framework. To top it off, it is in the board "PHP Applications, Frameworks and Libraries > Application Frameworks". Quote Link to comment https://forums.phpfreaks.com/topic/124905-best-ajax-friendly-framework/#findComment-651156 Share on other sites More sharing options...
DarkWater Posted September 30, 2008 Share Posted September 30, 2008 Maybe because that's not what the OP is asking. Yes you are correct.. But the title of the post says so. thats why I read this topic....And I only searched for the list .. No, it says best Ajax friendly framework. To top it off, it is in the board "PHP Applications, Frameworks and Libraries > Application Frameworks". I love the strong use of BBCode going on in this post. Kind of made me smile. Quote Link to comment https://forums.phpfreaks.com/topic/124905-best-ajax-friendly-framework/#findComment-653575 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.