Limitations in SASS Preprocessing in Theme Generation

This article documents the limitations for resolving potential startup performance issues when deploying custom themes and portlets in DXP 7.0. Note: the limitations are found only in 7.0.

When using DXP 7.x, some developers noticed that after deploying their custom theme or portlet, the platform would take a long time to start. They noticed there was no resource cache like the ones in Liferay Portal to handle CSS file creation. Recall that SASS was implemented in Portal 6.2 to help manage CSS files but also had potential errors.

Despite the potential issues with SASS and jRuby in the legacy portal, you might have expected to see something similar in DXP where CSS files are processed when users are browsing (at runtime). This is not the case. One major difference between Liferay Portal 6.2 and DXP 7.0 is most notably because of how SASS is handled. See the links in the Additional Information Section for more information in DXP 7.0.


Status: Limitation

DXP 7.0 functions in the following way:

  1. It is indeed true that the runtime generation of .sass-cache has been removed from DXP 7.0.
  2. On the other hand, Liferay DXP is still utilizing sass-cache; however, it is now happening at build time.
  3. For those interested in knowing how it works, the gradle task that generates the .sass-cache is buildCSS, which is implemented in the following class:

The overall result: Generating the .sass-cache values do not add additional delays when visiting the pages and there is little else that can be done to improve performance. No other settings are required to speed up the process for building or deploying modules.

Remember that there are other factors that affect overall performance, such as time to pre-compile JSPs, minification, whether SPA is enabled, the app server cache, or connecting to LDAP. Also keep in mind that there are other ways to improve performance; perhaps increasing the number of nodes in a cluster, JVM settings such as garbage collection, or tuning the load balancer.

Additional Information

¿Fue útil este artículo?
Usuarios a los que les pareció útil: 0 de 0