-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Constant caching #761
Comments
It is said that gzip does it better and uglifier shouldn't do his work. |
You might be right, but if gzip could take all he load for this, we wouldn't even shorten true and false to !0 and !1. If I recall correctly, jquery caches some strings and undefined. I don't think they would do it if it didn't bring anything to the table after gzip. |
Even gzipped, file with I'm not sure, but I think that jQuery caches this variables - not strings! - not for shortening, but for safety. |
Could we cache constants? Some strings (such as 'undefined', 'function', etc.), undefined, null, true, false, are used a lot! In unsafe mode, we could even cache Array.prototype, Object.prototype, [].slice (as in [].slice.call(arguments)). Large numbers may also be worth it to cache.
Declaring more safely cacheable things (such as window, document, document.documentElement, console, navigator) through an option could help us cache a ton of things.
The text was updated successfully, but these errors were encountered: