Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • valic Friend
    #129997

    I have see that many people are complaining to size of javascript ( mootools, and others)
    The easiest way to reduce it’s simple compress of this javascript.

    I will show two ways of reducing.

    First way ( easiest, but less effective)
    1. Open this link: http://shrinksafe.dojotoolkit.org/
    2. Choose mootools from your computer, and then press button shrink em
    (option “strip newline chars” – with that you gain extra kb less, 5-10kb, not neccessary)
    Image: 1876
    3. After you press button, just wait a couple second to download new (reduced mootools)

    Results:
    Mootools from Ja Fagus 184kb
    After: 68kb with option “strip newline chars”
    After: 72kb without option “strip newline chars”

    Second way ( a little more steps, but more effective) – version a and b
    A.version
    1.Open this link: http://dean.edwards.name/packer/
    2. Open mootools on your computer, with editor ( i use EditPlus).
    3. Select all, and copy to this page in first field.
    4.Then press button pack
    5. After couple second, in second field you will gain reduced mootools
    6. Then copy from second field, to your computer ( in old file -remove the old mootols, and save), or create new javascript file.

    Results:
    Mootools from Ja Fagus 184kb
    After: 71kb

    B. version : First three step are the same
    4. before you press button, you can select this two options

    • Base62 encode
    • Shrink variables

    and the press button pack.
    5,6 step are the same like in A version.

    Results
    Mootools from Ja Fagus 184kb
    After: 40kb

    Image:1877

    I use combination of Ja Barite and Ja Teline ii template, mootools it’s from ja_teline, and i have use version two for reducing mootools,
    And for highslide-with-html.js.

    Results:
    mootools from 184 to 40 kb
    Higslide javascript from 62kb to 25kb.

    I hope that i help somewhone with this tread.:cool:


    1. online_reducing
    2. manual-reduce
    mayke Friend
    #262418

    Hi VALIC,

    In Teline II V1.4 there is already file : highslide-with-html.packed.js beside highslide-with-html.js
    Do we still need to shrink them?
    Mind to share of what else that we can shrink more on Teline II V1.4?
    more lighter on Teline II V1.4 Script will make this template are beautifully unbeatable

    Michael Casha Friend
    #262438

    Great tutorial!

    instantinlaw Friend
    #262445

    I am going to give this a try valic.
    Thanks!

    mayke Friend
    #262453

    Thank you Valic,

    I Just did, so far nothing happend to the whole Teline II, but it faster.
    the result: highslide-with-html.js is : 65kb – 26kb
    Wished I knew wich one else that allowed to be shrinked of…

    valic Friend
    #262500

    mayke;69733Hi VALIC,

    In Teline II V1.4 there is already file : highslide-with-html.packed.js beside highslide-with-html.js
    Do we still need to shrink them?
    Mind to share of what else that we can shrink more on Teline II V1.4?
    more lighter on Teline II V1.4 Script will make this template are beautifully unbeatable

    hi, you don’t have to shrink then, but you can look it’s template used shrinked javascript or not.

    2Patrick Friend
    #262518

    Hi Valic

    Cool . Thanks
    Anything to improve the efficiency of execution of components or modules in Joomla ?

    mayke Friend
    #262528

    Thank you Valic, will do!

    valic Friend
    #262543

    2Patrick;69854Hi Valic

    Cool . Thanks
    Anything to improve the efficiency of execution of components or modules in Joomla ?

    Hi, i make the sam thing:

    1. reducing javascript
    2. compression of css files

    For reducing javascript for other addons, is the best that you try this, and test addon, if works, it’s ok.

    2. that it’s more recommended, compression of css files, i have made tutorial
    http://www.joomlart.com/forums/topic/gzip-compression-for-css-files-not-joomla-default-gzip/
    and i have show how to compress template_css.css from 30 to 5-10kb, and for news portal from 150kb to 10-20kb.

    This you can make for all addons – i have this made with jcomments component, and for couple modules

    Thing is, one module have css , per example 7kb, this is small, but if you use 10 modules, and some component, that is large all together, so compression for all css, it’s very good for web speed loading.

    In addition you can also have less external javascript and css files for better loading speed

    valic Friend
    #262544

    you can see on other templates – templateplazza, icetheme, youjoomla,
    all compress css an this way, for better loading, and i hope that joomlart will do same thing for templates

    2Patrick Friend
    #262558

    Hi Valic

    Thanks …you are way ahead of some of us

    I will try it soon and get back to you if I have any problems .

    Thanks once again

    ha le-viet Developer
    #262859

    The main reason to use the uncompressed edition of javascripts is it will be easier to track down the bug (if exists) and easily editing/modifying the code. You guys can compress whatever you want but remember to save one copy of uncompressed edition for later use.

    Thank you for introducing some other compression tools!

    Regards,
    Ha Le-Viet.

    2Patrick Friend
    #262970

    Hi Valic

    I found that Joomlaatwork sells Joomla cache -a component that “has the ability to compress, combine and compact Javascript and CSS files.

    On normal “hosting” environment the generation of a Joomla pages can take up to 0,4 – 1,4 seconds depending on the hosting environment and the number of components used. For large volume visitor sites this can result into slow performance of the website. When enabled this component can “generates” pages within 0,02 – 0,001 seconds (depending on your hosting environment)

    Since you are an expert, do you think that this would be a better solution for someone like me ( who wont to take the risk of opening and pasting files and then pasting them back again etc )!

    Do you have any views on this product ? Will it do exactly or better than what you proposed ?

    Thanks once again

    Omar Ramos JAEC
    #263107

    @2patrick

    I’ve been trying out the JRE Cache component today with Teline II and it’s been working really great. It kind of has the best of both worlds too because it allows you to keep your JS and CSS files in their normal formats (meaning you can still edit them later easily), but before displaying them to users they will go through the compression/compacting.

    The only problem I noticed in Teline II was that when JS compacting was enabled the All Videos Reloaded module on the right didn’t load up anymore in Internet Explorer (Firefox and Safari were fine though).

    For Teline II here’s a breakdown of the improvements (one of the big things about the optimization is that it compresses the multiple files into one file, lowering the amount of requests that the browser has to make, which improves responsiveness a lot):
    JS: 9 Files
    (9 Files) Total Size w/o Compression: 146KB
    (1 File) Total Size w/ Compression: 51KB (this is the setting I’m using at the moment)
    (1 File) Total Size w/Compacted: 135KB
    (1 File) Total Size w/Compression+Compacted: 47KB

    CSS: 12 Files
    (12 Files) Total Size w/o Compression: 50KB
    (1 File) Total Size w/ Optimization: 56KB
    (1 File) Total Size w/ Optimization+Compression: 13KB

    HTML:
    Total Size w/o Compression: 65KB
    Total Size w/ Compression: 16KB

    So total I’d be saving 181KB due to the compression, but there would also be less HTTP requests (for CSS+JS there’d be only 2 compared to 21) and the headers sent out for the JS and CSS are cached by the browser so there would be even less overhead with future requests.

    2Patrick Friend
    #263124

    Hi Omarram

    Thanks for the info – so it looks like a good component to buy ! Anything that can improve performance is worth looking at seriously.

    Concerned about the all videos part not showing …must check up with Joomlaatwork forum

    Thanks once again .

Viewing 15 posts - 1 through 15 (of 18 total)

This topic contains 18 replies, has 7 voices, and was last updated by  Omar Ramos 15 years, 9 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum