Help us learn about your current experience with the documentation. Take the survey.

应用程序缓存间隔

  • 版本:Free, Premium, Ultimate
  • 产品:GitLab Self-Managed

默认情况下,GitLab 会将应用程序设置缓存 60 秒。有时,您可能需要增加此间隔,以延长应用程序设置更改后,用户在应用中感知到这些变化的时间。

我们建议您将此值设置为大于 0 秒。如果将其设置为 0,则会导致每个请求都加载 application_settings 表,从而给 Redis 和 PostgreSQL 带来额外的负载。

更改应用程序缓存的过期间隔

要更改过期值:

  1. 编辑 /etc/gitlab/gitlab.rb 文件:

    gitlab_rails['application_settings_cache_seconds'] = 60
  2. 保存文件,然后重新配置并重启 GitLab 以使更改生效:

    gitlab-ctl reconfigure
    gitlab-ctl restart
  1. 编辑 config/gitlab.yml 文件:

    gitlab:
      application_settings_cache_seconds: 60
  2. 保存文件,然后重启 GitLab 以使更改生效。