Liferay DXP Free Tier    |    From download to running in minutes    |    Get started →

Blogs

提高liferay性能

Wan Gavin
Wan Gavin
Menys d'un minut de lectura

似乎总能听到liferay性能的抱怨, 在一个开源软件中这其实不难理解,就想一台公用的电脑,有人用oracle就在上面装个oracle,有人用DB2就又装了一个DB2…… 这些服务都启动自然就会慢。我们要做的就是停掉一些用不到的功能和方便开发人员debug的一些选项。

  • 启动速度相关参数:
    在不需要自动创建数据库结构的时候可以停掉此项:
#
  # Set this to true to automatically create tables and populate with default
  # data if the database is empty.
  #
  schema.run.enabled=false


      在不需要重新建立luence索引时

##Lucene Search
#Set the following to true if you want to index your entire library of files on startup.
index.on.startup=false

 

  • 提高运行时性能

      开启layout cache

# The layout cache filter will cache pages to speed up page rendering for
# guest users. See ehcache.xml to modify the cache expiration time to live.
com.liferay.portal.servlet.filters.layoutcache.LayoutCacheFilter=true

 

     压缩javascript文件

# Set this property to true to load the combined JavaScript files from the
# property "javascript.files" into one compacted file for faster loading for
# production. Set this property to false for easier debugging for
# development. You can also disable fast loading by setting the URL
# parameter "js_fast_load" to "0".
javascript.fast.load=true

 

     压缩 css 文件

# Set this property to true to load the theme's merged CSS files for faster
# loading for production. Set this property to false for easier debugging
# for development. You can also disable fast loading by setting the URL
# parameter "css_fast_load" to "0".
theme.css.fast.load=true

 

    开启vm模板cache

   # Set this to true in production so that VM templates are cached
  velocity.engine.resource.manager.cache.enabled=true

 

还有一些像auto.deploy.enabled这样的属性在不需要的时候也可以关闭,减少系统扫描的开销。

 

Comentaris de la pàgina
还可以在web.xml中配置关闭一些用不到的过滤器之类的功能。

Related Assets...

No s'ha trobat cap resultat

More Blog Entries...

Ben Turner
de novembre 26, 2026
Himanshu Chauhan
de novembre 20, 2026
Tony Lim
de novembre 19, 2026