OFBiz
  1. OFBiz
  2. OFBIZ-2864

Jawr API : Minifying, bundling and compression for Javascript and CSS

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Trivial Trivial
    • Resolution: Unresolved
    • Affects Version/s: SVN trunk
    • Fix Version/s: None
    • Component/s: ALL COMPONENTS
    • Labels:
      None
    • Environment:

      trunk 805338

      Description

      I would like to decrease pages weight, in order to increase page loading speed.
      A solution is to reduce Javascript and CSS files.

      The Jawr API (https://jawr.dev.java.net/) allows this function

      So, is it conceivable to implement Jawr API into OFBiz ?
      Or do you have a better API ?

      ***

      I'm trying to implement this API

      web.xml :

      <servlet-mapping>
      <servlet-name>CatalogUrlServlet</servlet-name>
      <url-pattern>/products/*</url-pattern>
      </servlet-mapping>
      <servlet>
      <servlet-name>JavascriptServlet</servlet-name>
      <servlet-class>net.jawr.web.servlet.JawrServlet</servlet-class>
      <init-param>
      <param-name>configLocation</param-name>
      <param-value>jawr.properties</param-value>
      </init-param>
      <load-on-startup>1</load-on-startup>
      </servlet>
      <servlet-mapping>
      <servlet-name>JavascriptServlet</servlet-name>
      <url-pattern>*.js</url-pattern>
      </servlet-mapping>

      jawr.properties :

      1. Basic global properties
        jawr.charset.name=UTF-8
        jawr.debug.on=true
        jawr.gzip.on=true
        jawr.gzip.ie6.on=false
      2. Basic JS/CSS servlet-specific properties
        jawr.js.use.cache=false
        jawr.css.use.cache=false
      3. JS bundle definition properties
        jawr.js.bundle.names=lib
        jawr.js.bundle.lib.global=true
        jawr.js.bundle.lib.id=/bundles/lib.js
        jawr.js.bundle.lib.mappings=/images/**

      But I can get the final Javascript file, calling :
      http://127.0.0.1/ecommerce/images/bundles/lib.js

      Could you help me please ?

      Eric

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Eric de Maulde
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development