Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-04-18 04:16:16

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 743

Optimizing plugin-loaded JavaScript & CSS

Interested in how people deal with this issue…

You want to make use of plugins like smd_slimbox, jnm_audio, the flash video embedder, etc… multimedia & ajax kinda things too I guess… which add calls to js in the head… but you already have a bunch of stuff linked from the head (jss for menus, striped & sortable tables, etc – not to mention css files galore) and these facilities aren’t in use on every article, so they create unnecessary server calls for the majority of pages…

and the multimedia add-ons are not limited to a single section or category… (which could have its own page template)…

any experiences? suggestions?

(Edit: updated discussion topic. -Mary)

Last edited by Mary (2007-04-18 06:25:55)

Offline

#2 2007-04-18 04:26:07

Walker
Plugin Author
From: Boston, MA
Registered: 2004-02-24
Posts: 592
Website

Re: Optimizing plugin-loaded JavaScript & CSS

I would figure out what JS pages could be strapped together into a larger page.

There’s really not much you could do about making less code. (unless you’re up for rewriting a whole lot)
But, you can make it so there’s that many fewer http page requests by making it one page.

Offline

#3 2007-04-18 04:32:44

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 743

Re: Optimizing plugin-loaded JavaScript & CSS

I hear u Walker, a sensible suggestion! instead of thinking about it I should be learning a modicum of javascript – could you pretty much bung em all together with a copy and paste? could make updating more tricky… but depends on your particular application I guess

Offline

#4 2007-04-18 04:34:19

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 743

Re: Optimizing plugin-loaded JavaScript & CSS

was thinking of using a custom field for ‘required apps’ – possible values being slimbox, audio, etc … parsed in the head on individual articles

Offline

#5 2007-04-18 06:07:01

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Optimizing plugin-loaded JavaScript & CSS

Most style sheets and script files are cached by the browser at the first request, so excluding them from parts of a site would just defer the load request, but not inhibit it. Depending on your site’s structure and usage patterns, of course.

Offline

#6 2007-09-22 16:09:28

obeewan
Archived Plugin Author
From: Stockholm, Sweden
Registered: 2004-08-12
Posts: 319
Website

Re: Optimizing plugin-loaded JavaScript & CSS

Walker wrote:

I would figure out what JS pages could be strapped together into a larger page.

You could bundle the javascripts together and minimize them using packer (or any other Javascript packing utility).

Or pack them individually ofcourse.

nardo wrote:

I hear u Walker, a sensible suggestion! instead of thinking about it I should be learning a modicum of javascript – could you pretty much bung em all together with a copy and paste?

If they are already packed it might create problems. Gotta try that someday =D.


Plugins: ob1_advanced_search 1.032b, ob1_search_score 1.0, ob1_pagination 2.5, ob1_title 4.1, ob1_modified 2.1

“Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt.”
— Sun Tzu

Offline

Board footer

Powered by FluxBB