Java Script Compression

How can I compress Scripts in FW 5 Pro?
Pages are php. I got this message:

Warning! The total size of external your scripts is 93108 bytes, which is over 20K. Consider optimizing your JavaScript for size, combining them, and using HTTP compression where appropriate for any scripts placed in the HEAD of your documents. You can substitute CSS menus for JavaScript-based menus to minimize or even eliminate the use of JavaScript.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Thomas,
Try this page action I wrote back in 2005;
http://www.freewayactions.com/test/js-code-crusher/js-code-crusher.zip

Simply apply it to a page and it will hunt and compress any script
blocks it finds in the document.
There’s no guarantee that the compressed JavaScript won’t break but if
the code is correctly written to start with then you should be fine.
The action also currently ignores any scripts added via markup items.
It should slim your JS down by 10-20%.

Additionally the Web Fast action (http://www.freewayactions.com/product.php?id=021
) may help as well.

Regards,
Tim.

On 17 Jun 2010, at 08:01, Thomas wrote:

How can I compress Scripts in FW 5 Pro?
Pages are php. I got this message:

Warning! The total size of external your scripts is 93108 bytes,
which is over 20K. Consider optimizing your JavaScript for size,
combining them, and using HTTP compression where appropriate for any
scripts placed in the HEAD of your documents. You can substitute CSS
menus for JavaScript-based menus to minimize or even eliminate the
use of JavaScript.

FreewayActions.com - Freeware and commercial actions for Freeway
Express & Pro.

Protect your mailto links from being harvested by spambots with Anti
Spam.
Only available at FreewayActions.com

http://www.freewayactions.com


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Tim, again: thank you. What would we do
without you, waltd and all the free Gods.

I’am currently working with Web Fast. Its
brilliant. But I guess it does’nt compress
JS. When I use the Crusher in FW 5 Pro, an
error message pops up – timeout.

I think we leave it like it is … bandwidth
are fat enough to “suck” my JS. :O)


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks for the feedback Thomas. The JS Code Crusher action is
currently hard coded with a timeout value to compress the code before
Freeway gives up on it. When I get a second I’ll adjust this so it
allows for bigger code blocks like yours.
You could try one of the online JS packers like this;

although you will have to add this compressed code in as markup and
then remove the original JavaScript which may prove to be quite a bit
of work.

Web Fast simply adds a line of PHP to the top of the page that asks
the browser to accept the data in a compressed form. If the browser
agrees then the page and associated assets are all sent in a
compressed format. The process is completely transparent and will
simply fall back if the browser refuses the compression request.
Regards,
Tim.

On 17 Jun 2010, at 10:53, Thomas wrote:

Tim, again: thank you. What would we do
without you, waltd and all the free Gods.

I’am currently working with Web Fast. Its
brilliant. But I guess it does’nt compress
JS. When I use the Crusher in FW 5 Pro, an
error message pops up – timeout.

I think we leave it like it is … bandwidth
are fat enough to “suck” my JS. :O)

FreewayActions.com - Freeware and commercial actions for Freeway
Express & Pro.

Protect your mailto links from being harvested by spambots with Anti
Spam.
Only available at FreewayActions.com

http://www.freewayactions.com


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options