Go to file
John Niang fb9aff00ca
Add chunked transfer support for rendering templates (#6580)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.20.x

#### What this PR does / why we need it:

This PR adds chunked transfer support for rendering templates, which means that the max memory used by rendering template will be max chunk size instead of size of rendering result.

Users can define the max chunk size like below:

```yaml
spring:
  thymeleaf:
    reactive:
      maxChunkSize: 8KB # Setting to 0 will disable the chunked response.
```

#### Special notes for your reviewer:

1. Try to start Halo instance
2. Execute the command like below and see if the response headers contain `transfer-encoding: chunked`:
		
    ```bash
	http http://localhost:8090/ -p h
	HTTP/1.1 200 OK
	Cache-Control: no-cache, no-store, max-age=0, must-revalidate
	Content-Language: en-CN
	Content-Type: text/html
	Expires: 0
	Pragma: no-cache
	Referrer-Policy: strict-origin-when-cross-origin
	Vary: Origin
	Vary: Access-Control-Request-Method
	Vary: Access-Control-Request-Headers
	X-Content-Type-Options: nosniff
	X-Frame-Options: SAMEORIGIN
	X-XSS-Protection: 0
	content-encoding: gzip
	set-cookie: XSRF-TOKEN=1e677724-ce82-4b63-911c-f78b22cd9169; Path=/
	transfer-encoding: chunked
	```

#### Does this PR introduce a user-facing change?

```release-note
优化模板渲染时所需的内存
```
2024-09-19 10:16:55 +00:00
.devcontainer Add devcontainer support (#6252) 2024-07-10 10:21:25 +00:00
.github chore: set up preview release with pkg.pr.new (#6547) 2024-08-29 13:49:22 +08:00
api Provide ElementTagProcessor to handle element tag in plugin (#6670) 2024-09-19 02:56:53 +00:00
api-docs/openapi/v3_0 Prepare for developing 2.20.0 (#6575) 2024-09-02 09:41:37 +00:00
application Add chunked transfer support for rendering templates (#6580) 2024-09-19 10:16:55 +00:00
buildSrc Support publishing to maven central repository (#3767) 2023-04-18 14:28:23 +08:00
config/checkstyle chore: add checkstyle rule (#2091) 2022-05-17 06:46:11 +00:00
docs Add before and after security web filters (#6297) 2024-07-09 14:05:24 +00:00
e2e chore: upgrade api-testing to v0.0.17 (#6253) 2024-07-02 15:21:24 +00:00
gradle/wrapper Upgrade to Gradle 8.8 (#6033) 2024-06-03 15:05:45 +00:00
hack chore: add cherry_pick_pull.sh for cherry-picking pull request (#1554) 2021-12-03 10:21:24 +08:00
platform feat: implement new mechanisms for generating and managing attachment thumbnails (#6454) 2024-08-26 10:27:14 +00:00
ui fix: correct ordered list styling issue in editor (#6656) 2024-09-13 09:40:26 +00:00
.dockerignore chore: rename console to ui in some files (#5347) 2024-02-07 14:40:08 +00:00
.editorconfig Support backup and restore (#4206) 2023-07-24 08:26:16 +00:00
.gitattributes Refactor .gitignore 2019-04-03 11:37:59 +08:00
.gitignore test: add e2e test cases of user, role, and plugin (#4920) 2023-11-28 21:52:44 +08:00
.gitpod.yml test: add e2e test cases of user, role, and plugin (#4920) 2023-11-28 21:52:44 +08:00
CODE_OF_CONDUCT.md docs: add CODE_OF_CONDUCT.md (#2150) 2022-06-12 08:10:12 +00:00
CONTRIBUTING.md docs: update the branch name from `master` to `main` in contribution.md (#5359) 2024-02-17 08:00:15 +00:00
Dockerfile chore: specify expose port in dockerfile (#5820) 2024-04-29 10:37:26 +00:00
LICENSE Create LICENSE 2018-03-21 21:39:46 +08:00
OWNERS chore: update reviewers for OWNERS file (#5672) 2024-04-09 15:22:09 +00:00
README.md Prepare for developing 2.20.0 (#6575) 2024-09-02 09:41:37 +00:00
SECURITY.md Mark the security policy for version 1.x as unsupported (#5450) 2024-03-06 06:06:07 +00:00
build.gradle Upgrade Spring Boot to 3.3.3 (#6512) 2024-08-26 02:51:13 +00:00
gradle.properties Prepare for developing 2.20.0 (#6575) 2024-09-02 09:41:37 +00:00
gradlew Upgrade Gradle to 8.6 (#5533) 2024-03-20 12:32:07 +00:00
gradlew.bat Upgrade to Gradle 8.8 (#6033) 2024-06-03 15:05:45 +00:00
settings.gradle Add build script for ui project 2024-02-03 22:51:50 +08:00

README.md

Halo logo

Halo [ˈheɪloʊ],强大易用的开源建站工具。

GitHub release Docker pulls GitHub last commit GitHub Workflow Status Codecov percentage Halo - Powerful and easy-to-use Open-Source website building tool | Product Hunt
官网 文档 社区 Gitee Telegram 频道

Watch the video


快速开始

docker run -d --name halo -p 8090:8090 -v ~/.halo2:/root/.halo2 halohub/halo:2.19

以上仅作为体验使用,详细部署文档请查阅:https://docs.halo.run/getting-started/install/docker-compose

在线体验

生态

可访问 官方应用市场awesome-halo 仓库 查看适用于 Halo 2.x 的主题和插件。

许可证

license

Halo 使用 GPL-v3.0 协议开源,请遵守开源协议。

赞助

如果 Halo 对你有帮助,欢迎赞助我们,感谢以下赞助者对 Halo 项目的支持:

sponsors

贡献

参考 CONTRIBUTING

状态

Repobeats analytics