tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thiago H. de Paula Figueiredo (JIRA)" <j...@apache.org>
Subject [jira] Commented: (TAP5-73) JavaScript libraries should be automatically packed/minimalized
Date Mon, 08 Jun 2009 15:14:07 GMT

    [ https://issues.apache.org/jira/browse/TAP5-73?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12717287#action_12717287

Thiago H. de Paula Figueiredo commented on TAP5-73:

>From http://tapestry.apache.org/tapestry5.1/guide/ajax.html

"Combining Scripts

In production mode, Tapestry automatically combines JavaScript libraries. A single request
(for a virtual asset) will retrieve the combined content of all referenced JavaScript library
files. This is a very useful feature, as it reduces the number of requests needed to present
a page to the user. As elsewhere, if the client browser supports gzip compression, the combined
JavaScript will be compressed."

I have just tested two different pages that use the same set of Javascript files and they
received the same URL: http://domainassets/virtual/H4sIAAAAAAAAAIXNQQrCMBCF4XGhXkREhE500QNN41SqlYS86aKeyat5B4mQgJu6$002ffl47$002fWm9ZNotSWiDR2dAGpw8GmIJn4awwTX8plP3LqYggWbo$002fINxMv2p2Z$002fWPba9$002brtK3dFmkSFpbmiErLaF9WN4u$002fdkC6V1ZJd83eteSggV83nHzax7d8QAQAA.js.
I'm not 100% sure, but I think Tapestry, for each requests, checks what Javascript files were
included. Then it checks if this file list was already combined into a single one: if not,
it does the combining in the spot and sets a far-future expire header on it (for caching).
If some of the included Javascript files is changed, then it does the combination again.

You can also run tests yourself and take a look at the sources.

> JavaScript libraries should be automatically packed/minimalized
> ---------------------------------------------------------------
>                 Key: TAP5-73
>                 URL: https://issues.apache.org/jira/browse/TAP5-73
>             Project: Tapestry 5
>          Issue Type: New Feature
>    Affects Versions: 5.0.15
>            Reporter: Howard M. Lewis Ship
> Tapestry should catch downloads of JavaScript libraries, and should "pack" the JavaScript
... remove comments and unecessary whitespace.  I believe Dojo has a library to do this, it
may even shorten variable names (!).
> A smart implementation of this would manage to cache the compressed JS, and notice when
the uncompressed version changed.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message