(888) 685-3101 ext. 2

Liferay Web Content
If you have custom code for rendering Liferay web content, you may not know it but you may not be leveraging Liferay caching for the rendered web content, and this may be at the root of some performance problems in your Liferay environment. Recently, one of our clients ran into this performance issue on one of their sites and I figured that I would share this issue and its solution with the Liferay community.

Oddly enough it seems the method that you’d assume you should use to get article content is badly behaved. The method in question is the JournalArticleLocalService’s getArticleContent method. This method should never be used in client code, as it automatically goes to the database to render your content request, entirely bypassing the cache.

Replace it with JournalContentUtil.getContent method. This first checks the Liferay cache. If the article is present in the Cache, it uses that. Otherwise, it delegates down to the JournalArticleLocalService getArticleContent method.

Make this change and your site should start to perform the way you and your end-users expect.

Share This