Merge/Combine Javascript Files

Status
Not open for further replies.

kushiel

Member
Is there a way to combine/merge the javascript files that Fabrik loads? I have a Joomla extension installed that combines javascript files but it misses 15 separate js files loaded by Fabrik. I'd love to find a way reduce the http requests. I did a search on the forum and saw mention of a "merge js" option in Fabrik 2.0 - are there plans to include such a function in 3.0? Or perhaps it's already there and I missed it?
 
Very strange you ask this question as I was only doing this sort of thing last night.

Yes indeed Fabrik 2.x did have the option of merging and compressing.

However Fabrik 3.x uses compressed javascript files already so no packer or compresser would be able to reduce them further. I did notice in my tests though that the Fabrik js files didn't merge with the rest. In terms of bandwidth though that isn't going to be a problem.
 
Good to know that they are already compressed. It would be cool to figure out a way to get them merged also, just to reduce the http requests. I'm not super worried about it, but it is kind of pain to have spent so much time optimizing my site and then see 15 separate js files loaded for each of my forms.

I wonder if the js merge function on 2.x was problematic which is why it was left out of 3.x, or if it wasn't worth the effort (because of js now being compressed), or it hasn't been done yet, or... ?
 
Yes most, (or maybe all), the Fabrik Javascript files in Fabrik 3.x have a compressed version and a uncompressed version.

As an example here for the field element.

https://github.com/Fabrik/fabrik/tree/master/plugins/fabrik_element/field

You will see a field.js and a field-min.js. The 'min' is the compressed version which is used in normal circumstances. The uncompressed version is used when you enable Joomla debug to make debugging friendlier when using something such as firebug.

I'm not sure why the merge function was left out though, it may simply be a case of not putting it in yet for Fabrik 3.x.

Every little tweak like this can only be positive for performance however I cannot speak about any negatives or whether Fabrik 3.x's new structure make this an easy task.

Hugh or Rob would have to advise on this but I think it would be a good ideas at least to reduce the http requests.
 
Ah ok, thanks for the clarification and link Rob. I had not heard of head.js. Sounds like I need not worry as Fabrik is already optimized for js downloads with this.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top