Jump to content
Search Community

kb weight not accurate

ActionDev test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

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

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

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

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.
×
×
  • Create New...