Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
ActionDev

kb weight not accurate

Recommended Posts

Hello, I am trying to use TweenLite and the CSS plugin. On the download area it says TweenLite is 7kb and that the css plugin is 12kb. When I download the files locally and save to a .js file I get 23kb for TweenLite and 31kb for css plugin.

 

What do I need to do to get the kb as displayed? Or is that information incorrect?

 

Thanks!

post-17573-0-76996000-1386712893_thumb.jpg

Link to comment
Share on other sites

Hi and welcome to the Greensock forums.

 

The kb indicated correspond to the files hosted in CDNJS that are GZIPPED and their weight is actually what is indicated in the download area. Actually what I'm getting in dev tools is the following:

  • CSS Plugin: 12.8 Kb
  • TweenLite: 8.5 Kb

Is always a good idea to use the downloaded and uncompressed files in local environment development and when you upload the finished work point to the CDNJS links and just in case have  fallback plan.

 

You can find the links here:

http://cdnjs.com/libraries/gsap

 

And for the fallback I always use yepnope.js:

http://yepnopejs.com/

 

Rodrigo.

Link to comment
Share on other sites

Yeah, as Rodrigo pointed out, Chrome's dev tools will show the compressed and un-compressed files sizes as shown in the image below

Screen Shot 2013-12-10 at 6.15.17 PM.png

Link to comment
Share on other sites

Also, if you want to host the GSAP files yourself, you can just make sure that gzip is enabled on your server to get the same gzip'd file sizes (with the added benefit of compressing all of your other scripts too!).

 

It's not too difficult if I recall correctly; there should be plenty of tutorials out there in internet land on setting it up, otherwise your site host might be able to help (or perhaps they already had it enabled for you?).

  • Like 2
Link to comment
Share on other sites

Thanks for responses everyone. I am working on a project that needs all files saved locally. Would there be a way to save the libs in gzip format and have a loader like yepnope.js that can extract?

 

Thanks!

Link to comment
Share on other sites

You don't really need to save anything in gzip format (well of course you can precompress files if you want to, but that's a little more involved).

 

gzip is just something you setup on your server to send zip'd files for transmission. The files on your server can be regular files with regular file sizes. When the user requests a file, Apache or whatever zips the file and sends it, and then the browser unzips it and uses it - entirely automatic.

 

I just googled gzip and saw this - the explanation and instructions seem ok, but it's something you'll need to determine for yourself. We can't really get deep into server support in this forum.

  • Like 2
Link to comment
Share on other sites

I was not clear on that thanks for helping understand. Looks like I need to keep as is or push to allow linking to server.

 

Thanks again for everyones help.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×