[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.javascript

JavaScript Packers, Compression & Decompression

0ntariokingston

11/27/2014 11:34:00 AM

www.ScriptCompress.com is trying to provide compression to JavaScript because not all servers have compression. It is not only responsibility of the web server to compress, think about it. Why not client side compression so I can send form data back to server compressed (just one of thousands of examples)?

If you pack a JavaScript, it may not compress as well with Gzip, here we need an alternative like bzip. Get with the program JavaScript!

*Why does JavaScript not support decompression of top formats?* It is time to make a proper language that has all good compression formats built in (lpaq, lzma, lz77, bzip, Gzip, zip, rar, lha, etc, etc, etc). It is standard need on a computer, and the internet is run by computers, so only seems logical.

Developers need to be able to find a match for their needs. One compression may work well on say text, but another works better on binary data (like run length encoding algorithm I came up works well on a bunch of zeros and ones, but on a javascript it inflated many times over). I have found mixing a few together in certain combinations results in more savings than any used alone.

Can't tell me it's not possible, file type svgz can open natively on most browsers and it is just a svg that is gzipped! Why not htmlz, jpgz, cssz, etc? Here is sample of HTML hacked to SVGZ: http://imgh.us/1MB-HTML5-Holy-... (this was a huge task making the Bible this small, takes a bit to extract and load because I had to combine so many techniques to compensate for bloating of Base64), it's the World's smallest fully complete HTML5 Bible that was originally 4.5MB but now 1MB (if browsers supported compression I could have skipped base64 and got down to 900KB plus less time decoding base64 about 2 times). I had to pack it to JavaScript (scriptcompress.com makes self extracting search/replace compressed script mixed with bzip), compress bzip, encode Base64, minify, convert to SVG foreignObject tag (inject to iframe) and final stage was gzip I left raw compressed data.

*Why doesn't JavaScript have built in decompression for all the top formats?*

Compression is not just responsibility of the server side hosting. I myself use many paid services or free services that do not compress. Why can't I use compressed files on them? Because web browsers won't do their part! Look at all the trouble I have to go through to host a gzipped webpage on a server without compression: first I use HTML packer on scriptcompress.com to make it complete javascript, now I bzip with tools on same site, then convert to SVG image and then gzip it https://plus.google.com/108316513308693963076/posts/S... - GRRRRRR!

I should be able to say have an HTML page zipped up. So we have index.html that is now index.html.zip. The browser should now see they expect a name of index and extension html, so browser would know that to unzip what internal function it needs, then extract the page then view it. SO SIMPLE!

index.html.gz = gzipped index.htm
index.html.bz =bzip
logo.png.gz = an image gzipped

The browser would first extract all related files in same recursive directories, then your pages can now call say logo.png instead og logo.png.gz. By first extracting everything, you could now call other files that were packed in say index.html.gz (maybe you added css or js files for instance), basically the name is just a place for the extractor to start when executing something

If browser told to open index.html.gz it would extract with gzip and run index.html so if you had css and js files to go with the page without a URL linking to external resources, you would either have to embed code with base64 and dataURLs or just simply include the files inside index.html.gz without any (file renaming)

The browser should check again for compressed files incase some compressed files were compressed before compression.

Search engines (like Google) are going to have to start decompressing files to get meta data. All my attempts of self extracting web pages fail because people complain that all stuff is now hidden from search engines! Would be nice if a JavaScript contained eval a search engine would actually run it to get data as I find great technique to pack HTML in doc write and then compress into self unpacking scripts. Actually, would be nice if web browser just took pure compressed files to save me that trouble of packing!

I could take Chrome source and probably make it the way it should be, but would take me forever by myself and I cannot afford to donate that much time (I would have to still earn money elsewhere and sleep). Even if I spent a year doing it, it can't be copyrighted and all the other browsers will copy after I show that an extra MB of data is all it took to save terrabytes a day... Yes, 1MB, I have almost 50 various JavaScript compressors/decompressors in testing phases (LZMA to PAQ), and codes are less than 1MB total (heavily minified), about 10 of these (lha, lzrc, sppmc, p12a, lzp, lzari, ppmhuff, lzb, dmc, mnzip, fgk, etc) I get over 50% compression and will be integrated to scriptcompress.com eventually. That 50% compress rate is after Base64 encoding (such a waste, lose 30%, but browser forces me to make it safe).


33 Answers

genat

9/15/2008 7:01:00 AM

0

I missed Geraldo, 'that' would have been funny.

But so many of those newscasters were out in the wind and rain, why? I mean
the one CNN guy had his back turned coz he was afraid some roof that just
blew off was gonna hit him!! And Anderson Cooper up to his waist in water?
Ridiculous. And what if that supposedly 'sturdy' structure came down, I mean
how do you know it won't? They are asking people to evacuate or be killed
and you have all these news people sticking around just to be the first to
send back live pics. I can wait to see them after the storm subsides, really
I don't need to see the eye of the hurricane putting folks in danger.


"The Mighty TB" <partyslammer@sowcal. ahrahr.com> wrote in message
news:7uGdnZ6JfapWYlDVnZ2dnUVZ_hydnZ2d@giganews.com...
> "genat" wrote:
>
>> Well, it was headline news you know. My only problem is the anchors that
>> head there in harms way just so they can broadcast it while it is
>> happening. I find that totally unnecessary.
>
> Speaking specifically about the live coverage as Ike made landfall over
> night this weekend, most of the reporters at least from KHOU shown outside
> were broadcasting either from the well-shielded parking structure at The
> Hilton next to Nassau Bay positioned so the structure blocked much of the
> wind and rain or from the front entrance to The Hilton itself. Once winds
> got pretty dangerous by nightfall, no one was actually standing
> unprotected outside. The way the cameraman and reporter would usually be
> positioned, it looked like the reporter would be in imminent danger of
> being clobbered by a tree or something. Still, I understand those KHOU
> reporters did get a bit of a scare when the lobby filled with at least 5
> feet of water late that night.
>
> I will add it was hilarious seeing Geraldo being knocked down on his ass
> by a wave while grandstanding at the waterfront Friday morning.
>
> T.B.


MFalc1

9/15/2008 7:38:00 AM

0

On Sep 14, 11:25?pm, "The Mighty TB" <partyslammer@sowcal. ahrahr.com>
wrote:

> I will add it was hilarious seeing Geraldo being knocked down on his ass by
> a wave while grandstanding at the waterfront Friday morning.
>
> T.B.

And there was also the spectacle of Rick "I don't need a raincoat"
Sanchez out in the field for CNN.

Mark L. Falconer-film and video links at
http://hometown.aol.com/mfalc1/...

Denise

9/15/2008 10:14:00 AM

0

On Sep 15, 3:01?am, "genat" <backstre...@verizon.net> wrote:

>
> >> Well, it was headline news you know. My only problem is the anchors that head there in harms way just so they can broadcast it while it is happening. I find that totally unnecessary.
>

Funny though, what I remember best about the pre-Katrina eye coverage
was Anderson and the gradually moving 100 pound potted plant ;-)

And there's no way I cannot watch that hunk, Rob Marciano!

William Longyard

9/15/2008 10:46:00 AM

0


"genat" <backstreets@verizon.net> wrote in message
news:TKnzk.125$nl3.16@trnddc05...
And Anderson Cooper up to his waist in water?
> Ridiculous.


Yes, that was ridiculous. Why not just get on your knees and beg for
ratings?

Bill L.


fearless freep

9/15/2008 3:43:00 PM

0

On Sep 15, 6:14 am, Denise <LuvTheB...@aol.com> wrote:

> And there's no way I cannot watch that hunk, Rob Marciano!

Wow, I hate to do this to you Denise, but your boy Rob is a big time
bonehead.

Watch and read.

http://www.youtube.com/watch?v=S...

http://www.dailykos.com/story/2007/10/4/...

Denise

9/15/2008 6:10:00 PM

0

On Sep 15, 11:42?am, fearless freep <dntroa...@aol.com> wrote:
> On Sep 15, 6:14?am, Denise <LuvTheB...@aol.com> wrote:
>
> > And there's no way I cannot watch that hunk, Rob Marciano!
>
> Wow, I hate to do this to you Denise, but your boy Rob is a big time
> bonehead.
>
> Watch and read.
>
> http://www.youtube.com/watch?v=S...
>
> http://www.dailykos.com/story/2007/10/4/...


Yeah I knew. Doesn't mean I don't like to look at him, I can turn the
sound off! ;-)

Evolution

9/15/2008 6:15:00 PM

0

Denise wrote:
> On Sep 15, 11:42???am, fearless freep <dntroa...@aol.com> wrote:
>> On Sep 15, 6:14???am, Denise <LuvTheB...@aol.com> wrote:
>>
>>> And there's no way I cannot watch that hunk, Rob Marciano!
>> Wow, I hate to do this to you Denise, but your boy Rob is a big time
>> bonehead.
>>
>> Watch and read.
>>
>> http://www.youtube.com/watch?v=S...
>>
>> http://www.dailykos.com/story/2007/10/4/...
>
>
> Yeah I knew. Doesn't mean I don't like to look at him, I can turn the
> sound off! ;-)

Now that kind of idiocy just turns me off... I can't separate the mind
from the face/body.

Laurie

fearless freep

9/15/2008 6:19:00 PM

0

On Sep 15, 2:09 pm, Denise <LuvTheB...@aol.com> wrote:
> On Sep 15, 11:42 am, fearless freep <dntroa...@aol.com> wrote:
>
> > On Sep 15, 6:14 am, Denise <LuvTheB...@aol.com> wrote:
>
> > > And there's no way I cannot watch that hunk, Rob Marciano!
>
> > Wow, I hate to do this to you Denise, but your boy Rob is a big time
> > bonehead.
>
> > Watch and read.
>
> >http://www.youtube.com/watch?v=S...
>
> >http://www.dailykos.com/story/2007/10/4/...
>
> Yeah I knew.  Doesn't mean I don't like to look at him, I can turn the
> sound off! ;-)

Maybe it'll make it easier for you to understand why some of the boys
like to look at Palin. I used to be one of them but now she's totally
on my last nerve.

Denise

9/15/2008 6:22:00 PM

0

On Sep 15, 2:19?pm, fearless freep <dntroa...@aol.com> wrote:
> On Sep 15, 2:09?pm, Denise <LuvTheB...@aol.com> wrote:
>
>
>
>
>
> > On Sep 15, 11:42 am, fearless freep <dntroa...@aol.com> wrote:
>
> > > On Sep 15, 6:14 am, Denise <LuvTheB...@aol.com> wrote:
>
> > > > And there's no way I cannot watch that hunk, Rob Marciano!
>
> > > Wow, I hate to do this to you Denise, but your boy Rob is a big time
> > > bonehead.
>
> > > Watch and read.
>
> > >http://www.youtube.com/watch?v=S...
>
> > >http://www.dailykos.com/story/2007/10/4/...
>
> > Yeah I knew. ?Doesn't mean I don't like to look at him, I can turn the
> > sound off! ;-)
>
> Maybe it'll make it easier for you to understand why some of the boys
> like to look at Palin. ?I used to be one of them but now she's totally
> on my last nerve.- <

OH you would most definitely have to turn the sound off. Even if one
found her attractive- her voice is soooo.... like someone here said,
she's a shrew!

and she doesn't have Rob's physique ;-)

Christoph M. Becker

11/27/2014 12:46:00 PM

0

Chris White wrote:

> *Why doesn't JavaScript have built in decompression for all the top
> formats?*

Because it is not the job of JavaScript to decompress anything
transmitted via HTTP -- it is generally the client's job, see RFC 2616
section 3.5[1] (resp. the newer RFCs obsoliting RFC 2616). If you want
better/other content-codings, you can propose them -- but this is OT in
this newsgroup, anyway.

> All my attempts of self extracting web pages fail because people
> complain that all stuff is now hidden from search engines!

Not only from search engines, but from all clients that don't support
the required scripting language. Note that the HTML5 specification says[2]:

| Authors are also encouraged to make their applications degrade
| gracefully in the absence of scripting support.

[1] <http://tools.ietf.org/html/rfc2616#secti...
[2] <http://www.w3.org/TR/html5/scripting-1.html#scrip...

--
Christoph M. Becker