This is really great advice. For a large scale app, you're going to want to have some sort of build process that optimizes your javascript and concatenates files, so you'll be able to structure your project logically and then output a highly compressed single file for production.
You can also put everything in separate files and use a PHP script to automatically concatenate them upon request. Normally this would be a bad idea because it could be slow, but if you instruct the container to cache the output of the PHP script, then your server won't even take a hit for most of the loads of your application. ~Arne On Jun 17, 6:31 am, Navaneeth Krishnan <[EMAIL PROTECTED]> wrote: > A few tips: > For (1), You could split your javascript into separate modules in your > development environment. During your > build process you can concat the relevant js files and run it through a > javascript/css compressor likethe YUI Compressor. The compressor strips off > code comments and also does a bunch of optimizations to > give a single js file that you can use for your deployment. > You can also consider generating separate js files for your profile view and > canvas view, because typically > the profile view will require much less javascript. This will ensure that you > load up faster on the user profile. > (2) will depend largely on your application itself. Usecached makeRequestif > you expect duplicates and, > as Aakash mentioned, the app data store, if you just want to store small > amounts of data. > Hope that helps ! > Navaneeth > prafulla wrote:Hi all, Of late, I have started building large scale > applications using Opensocial API, and I notice that my code involves lots of > makeRequest calls and many callback functions. Using all this javascript in a > single xml file might not be the best way to do it. Are there any guidelines > on : 1) how to keep the code neat and good-looking 2) ways to minimize > multiple makeRequest calls Also, I am not sure whether it is a good practice > to break up my javascript into multiple smaller files. This will improve code > readability, but I am afraid that it might increase the latency because the > application now has to access more number of files. Please provide me your > suggestions and views on this. Thank you, Prafulla --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "OpenSocial Application Development" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/opensocial-api?hl=en -~----------~----~----~----~------~----~------~--~---
