Skip to content

Commit

Permalink
feat: 开启Brotli压缩提升网页浏览性能
Browse files Browse the repository at this point in the history
  • Loading branch information
gua committed Nov 17, 2023
1 parent 19dbabf commit 339e64f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .docker/etc/nginx/http.d/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ server {

server_name _;

# 开启 brotli 压缩
brotli on;
brotli_static on;
brotli_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;

# 开启 gzip 压缩
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ docker-compose.yml
storage/laravels.conf
storage/laravels.pid
storage/laravels-timer-process.pid
cli-php.ini
cli-php.ini
frontend
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr

RUN install-php-extensions pcntl

RUN apk --no-cache add shadow supervisor nginx sqlite
RUN apk --no-cache add shadow supervisor nginx sqlite nginx-mod-http-brotli

#复制项目文件以及配置文件
WORKDIR /www
Expand Down
Binary file added public/theme/Xboard/assets/umi.js.br
Binary file not shown.

0 comments on commit 339e64f

Please sign in to comment.