Projects‎ > ‎XForms‎ > ‎

Automatic Aggregation of JS and CSS Resources for XBL and User Files

Status

This is implemented as of 2011-02-23.

Rationale

Currently, only CSS and JavaScript directly known to the XForms engine is aggregated. This was done to improve the performance of page loads.

Currently, with XBL components, too many CSS and JavaScript files are loaded. Those as well as user-defined CSS and JavaScript files must also be handled.

See RFE.

Ideas

Currently:
  • based on notion of "feature", e.g. "dialog", "rte", etc.
  • XFormsResourceServer knows about features and able to produce right content
New:
  • feature-based approach probably not working anymore with lots of XBL controls and user content
  • possible solution:
    • resource name is a digest of all paths to resources used
    • => somebody must know mapping between digest and paths, or digest and data
    • possibly: when page is loaded, resources are generated and cached on disk (like with current resource cache mode)
  • finding paths
    • combination of
      • XForms paths
      • XBL paths
      • user paths, detected in HTML HEAD
      • XHTMLHeadHandler can filter, digest paths, and generate CSS and JavaScript file names
  • resources will be served by XFormsResourceServer
Benefits:
  • improve the performance of page loads
  • also allows URL rewriting in CSS for Form Runner proxy portlet
Drawbacks:
  • need to store/cache mapping hash of paths -> list of resources (was not necessary with old system)
Comments