The current prototype.js is about 130kb, on a high performance site
this is quite a lot. Does anyone have an idea how I can only use the
Ajax portion of prototype.js so the .js file gets smaller?
> The current prototype.js is about 130kb, on a high performance site > this is quite a lot. Does anyone have an idea how I can only use the > Ajax portion of prototype.js so the .js file gets smaller?
Best best: offload it to Google's CDN using their "Ajax Libraries APIs" offer [1].
Otherwise, you can just configure your web server to GZip it (~30KB) and set a long cache expiry to it, that does nicely as well.
Or you can make compression with one of the known progs, that removes
comments, freespaces etc and get the version about 76 kb.
On 21 июл, 12:27, ACES Direct <i...@acesdirect.nl> wrote:
> The current prototype.js is about 130kb, on a high performance site
> this is quite a lot. Does anyone have an idea how I can only use the
> Ajax portion of prototype.js so the .js file gets smaller?
Configuring your web server to gzip it is easier than you'd think. If you're interested, here's a link. IT's for gzipping CSS, but with some tweaks you can apply it to javascript files, too. It relies on .htaccess files, so you'll need the appropriate server environment.
> ACES Direct a écrit : > > The current prototype.js is about 130kb, on a high performance site > > this is quite a lot. Does anyone have an idea how I can only use the > > Ajax portion of prototype.js so the .js file gets smaller?
> Best best: offload it to Google's CDN using their "Ajax Libraries APIs" > offer [1].
> Otherwise, you can just configure your web server to GZip it (~30KB) and > set a long cache expiry to it, that does nicely as well.
I totally agree with gzipping.
Minified and gzipped Prototype is 20.7kb.
Currently YUI Compressor is compatible with Prototype 1.6.0.2 and its
use of the $super variable.
I have also modified a version of Dean Edwards packer 3 to support the
$super variable.
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won't work. You can use the following
# workaround to get the desired effect:
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary