gogs/gogs

加载慢

grd291 opened this issue · 10 comments

What needs to be improved? Please describe

非常好用的软件,最近突然出现加载慢的问题,经过排查不是网络和部署的原因,不是项目有加载比较慢的链接、请看截图,是否能提供帮助
image
Uploading image.png…
如果可以请帮助谢谢

Why do you think it is important?

加载的时候要等待4-8秒很难受

Code of Conduct

  • I agree to follow this project's Code of Conduct

Try offline mode?

gogs/conf/app.ini

Lines 43 to 44 in b89f20e

; Whether to disable using CDN for static files regardless.
OFFLINE_MODE = false

非常感谢您能回复,我的设置里“ OFFLINE_MODE = false ”一条是生效的,并且头像的加载问题也设置了,请问还可能是什么原因?

并且在本地也是这样,不使用外网本地访问也是这种情况
image

Try OFFLINE_MODE = true? 🤔

嗯尝试了还是不行,对前端不太了解,我截几张图,请您有空帮忙看一下是不是和cookie或session有关系。
image
image
image

这是我的app.ini,我的部署环境是windows 2016 server

BRAND_NAME = G.R.D-Git
RUN_USER = G.R.D-Servers2$
RUN_MODE = prod

[database]
TYPE = mysql
HOST = 127.0.0.1:3306
NAME = gogs
SCHEMA = public
USER = root
PASSWORD =root
SSL_MODE = disable
PATH = C:\Git\gogs\data\gogs.db

[repository]
ROOT = D:\Git\gogs-repositories
DEFAULT_BRANCH = master

[server]
DOMAIN = gogs.grd.com
HTTP_PORT = 1003
EXTERNAL_URL = https://gogs.grd.com/
DISABLE_SSH = false
SSH_PORT = 22
START_SSH_SERVER = false
OFFLINE_MODE = true

[repository.upload]
; Whether to enable repository file uploads.
ENABLED = true
; The path to temporarily store uploads (content under this path gets wiped out on every start).
TEMP_PATH = data/tmp/uploads
; File types that are allowed to be uploaded, e.g. "image/jpeg|image/png". Leave empty to allow any file type.
ALLOWED_TYPES =
; The maximum size of each file in MB.
FILE_MAX_SIZE = 300
; The maximum number of files per upload.
MAX_FILES = 5

[mailer]
ENABLED = false

[auth]
REQUIRE_EMAIL_CONFIRMATION = false
DISABLE_REGISTRATION = false
ENABLE_REGISTRATION_CAPTCHA = true
REQUIRE_SIGNIN_VIEW = false

[user]
ENABLE_EMAIL_NOTIFICATION = false

[picture]
DISABLE_GRAVATAR = true
ENABLE_FEDERATED_AVATAR = true

[session]
PROVIDER = file

[log]
MODE = file
LEVEL = Info
ROOT_PATH = D:\Git\gogs\log

[security]
INSTALL_LOCK = true
SECRET_KEY = GBsNkm1FZDl3Bec

[other]
SHOW_FOOTER_BRANDING = false
; Show time of template execution in the footer
SHOW_FOOTER_TEMPLATE_LOAD_TIME = true

SHOW_FOOTER_VERSION = true

[i18n]
LANGS = zh-CN
NAMES = 简体中文

;用于 jQuery DateTimePicker,
;https://xdsoft.net/jqplugins/datetimepicker/#lang 中支持的语言列表
[i18n.datelang]

zh-CN = zh

FYI you just posted your secret (SECRET_KEY) stored in the app.ini...


Can you find out which exact request that is slow? I am not able to see that in your screenshot.

目前是只要点击项目进去就会满,首页、设置界面也不会慢。具体慢的请求类型是:document,亲请求是GET。比如:https://gogs.grd.com/guorui/html_learn

其中“html_learn”这个是我的仓库名称。有可能是和“SECRET_KEY”相关么

I don’t know what could be causing it. Have you done anything on the server before you noticed it became slow to load?

Is repository home page the only page that’s slow? What about user settings page?

感谢您,我再研究一下。