-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add chunked transfer support for rendering templates #6580
Add chunked transfer support for rendering templates #6580
Conversation
Signed-off-by: JohnNiang <[email protected]>
Quality Gate passedIssues Measures |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6580 +/- ##
============================================
- Coverage 58.18% 58.11% -0.08%
- Complexity 3774 3919 +145
============================================
Files 651 670 +19
Lines 22125 22990 +865
Branches 1538 1573 +35
============================================
+ Hits 12873 13360 +487
- Misses 8641 9012 +371
- Partials 611 618 +7 ☔ View full report in Codecov by Sentry. |
此 PR 会导致部分插件的功能失效,比如: 暂不确定是否有其他插件也有类似的问题。 |
失效的插件可以参考 halo-sigs/plugin-page-cache#10 来修复这个问题。另外,这两个需求建议通过 Thymeleaf 的扩展来实现。 |
/ping @halo-dev/sig-halo I have refactored plugin plugin-webp-cloud in webp-sh/halo-plugin-webp-cloud#15 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: guqing The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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:
Special notes for your reviewer:
Try to start Halo instance
Execute the command like below and see if the response headers contain
transfer-encoding: chunked
: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?