Jump to content
Search Community

CSSPlugin File Size

Citizen Woodward 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 everyone,

 

It's my first time building HTML5 banners for a commercial client and I'm posting here because I've noticed something strange. The file size for the CSSPlugin seems very large: 39kb for the minified and 148kb uncompressed. This doesn't seem right to me when you compare it the other file sizes (TimelineLite is only 12kb minified). I've downloaded the latest GSAP JS package (twice) and that is the file size I'm being told. Is this a bug of some kind? Is my computer lying to me? Or has the CSSPlugin shot up in size?

 

I've got to keep everything under 150kb and I only need to include TweenLite, TimelineLite, and the CSSPlugin.

 

Any thoughts on the matter are much appreciated. Thanks. 

Link to comment
Share on other sites

CSSPlugin is about 15kb gzipped. I wonder if you're looking at non-gzipped numbers? Keep in mind that CSSPlugin does a LOT of work (things like compatibility assurance, unit conversions, complex string/property parsing, transform matrix composition/decomposition, advanced color operations, directional rotation, class property comparisons, SVG wizardry, etc.).

Link to comment
Share on other sites

I strongly suggest that there should be a "light" version of the CSS plugin. Yes it's only 15k gzipped, but the filesize that is accounted for when publishing is the non-gzipped size. We often have a 150k limit with banners, and most of the time the designs we have to animate have transparency... we therefore are stuck with using heavy 32 bit png images. Every bit we can save on scripts is a bit we can use on images. For that reason, we were forced to program our own "plugin" for banners, since we cannot afford to include the CSSPlugin, but it's certainly not as robust as we wished.

 

Since banners are html5, a css plugin with a limited backwards compatibility would save space. Also, maybe a subset of the properties we can animate would suffice (I'm thinking scale, rotation, opacity, position).

 

Link to comment
Share on other sites

Hmm...I'm curious about who is telling you that file size is measured as non-gzipped. I've never heard that and it conflicts with what the IAB officially recommends and what we've heard from pretty much every major network. Are you sure? 

 

As for creating a "lite" version of CSSPlugin, we've tinkered with that idea but ultimately there are a bunch of down sides to that which you can read about in the whole "TweenMax/TweenNano" comments here: http://greensock.com/html5-banners/#TweenNano. I think it'd actually do more damage than good. 

 

Also, every major network that we know of has committed to supporting GSAP on their CDN and not counting its file size against the ads (unless a specific publisher requires it which would be against the networks' recommendation). So you really shouldn't have to worry about the size of CSSPlugin (or TweenMax) at all.

 

Do you mind me asking what network you're going through? I think you may be getting some faulty information somewhere. 

  • Like 3
Link to comment
Share on other sites

You are right about gzip, I was mistaken on that, mostly because we are at the end of the flow, and we often deal with people who make their own interpretations of the standards. The publisher requests are ultimately what we deal with, even if they are misinformed. I remember a case (back in the good ole' Flash days) where we had to fit an ad in mac's "size on disk" information instead of the actual file size... I think there is a lot of unclear information out there, and people tend to be on the conservative side of things when in doubt.

 

As for the support for GSAP on the CDN, we deal with https://support.google.com/adwordspolicy/answer/176108?hl=en (section all other html5 ads) which clearly state that the only thing that can be external is jQuery and google fonts. I did not find any information about GSAP in their doc. 

 

We also deal with adgear, and here is what they have to say : While AdGear uses its own CDN to deliver files, we also allow developers to use other CDNs to host library and framework code. Note that publishers and ad exchanges will still include those files' sizes in the max ad file weights. (ref. https://adgear.atlassian.net/wiki/pages/viewpage.action?pageId=1081360)

Link to comment
Share on other sites

Thanks for all the additional info. Just to clarify something, AdWords does have their own rules regarding GSAP. 

You need to upload TweenMax with your ad (just like your images) and reference it locally and it will count towards filesize. However, after gzipping, all of TweenMax (including TweenLite, TimelineLite, TimelineMax, CSSPlugin and more) is only about 34kb of your post-zip 150kb limit. 

 

I hate to be so vague but we know Google is working towards ways of having GSAP not count as filesize on AdWords. 

Link to comment
Share on other sites

Thanks for your reply. If you get more information about Google's support for GSAP, I hope you will post it on your website somewhere... maybe along with information regarding the presence/paths of GSAP in the CDNs of all ad networks? :)

Link to comment
Share on other sites

We'd love to post the URLs to each network's CDN-ified TweenMax file(s), but unfortunately every one of them seems to be very apprehensive about offering that because they want to make sure that only ads on their networks are pointing to those files. So we don't have their permission to share those URLs at this point. 

 

We know Google is working on full support for GSAP and exemption from file size across every one of their networks, but it's taking some time. If you want to speed up the process, we'd encourage everyone to contact Google about it. The squeakier the wheel, the more likely it is to get greased. :) They need to see how strong the demand is. Please don't be obnoxious, but keep letting them know how important GSAP support is to you, their customers. 

  • 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...