TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
View Poll Results: Combine JS files or not?
Combine 2 66.67%
Keep seperate 1 33.33%
Voters: 3. You may not vote on this poll

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 07-24-2008, 09:42 PM   #1 (permalink)
The Visitor
 
Hempsworth's Avatar
 
Join Date: Jul 2008
Location: Hereford, UK
Posts: 4
Thanks: 0
Hempsworth is on a distinguished road
Bricks To combine JS or not?

We're working on a CMS which will allow third party developers to create extensions for the system (modules). We want to allow developers the use of the pre-installed jQuery JS library and the various elements of the new jQuery UI library (and other popular JS libraries) for their animated, Ajax driven admin panels.

To keep the JS loading time as small as possible the developer will specify which elements of the UI library they will need (see the download builder), and the system will then output only the JS their module really needs. And if more than one module needs the same JS the system won't load it twice.

Now my question is this...

Should we load a separate JS file for each UI element, eg:

jqueryui-draggable.js
jqueryui-sortable.js

A local cache of them can be stored, but there are more HTTP requests as certain pages may need quite a few different elements.

Or should we combine these and pack them dynamically using PHP, into one JS file - which makes a smaller filesize and less HTTP requests, but no cache because the content will change.

I just need to weigh up which is quicker!

What are your thoughts? Any useful research you know of?
Send a message via MSN to Hempsworth Send a message via Skype™ to Hempsworth
Hempsworth is offline  
Reply With Quote
Old 07-24-2008, 11:00 PM   #2 (permalink)
The Contributor
 
ryanmr's Avatar
 
Join Date: Jun 2008
Location: Twin Cities, Minnesota, USA
Posts: 44
Thanks: 3
ryanmr is on a distinguished road
Default

I would combine all of the files into one, or you take a look at Google's Ajax Libraries, which has the major libraries hosted and packed and gzipped.
ryanmr is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 04:14 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design