Opened 10 years ago
Last modified 8 years ago
#11802 closed enhancement
Ability to send chunked response in Request.send — at Version 10
Reported by: | Jun Omae | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.6 |
Component: | rendering | Version: | |
Severity: | normal | Keywords: | chunked |
Cc: | leho@… | Branch: | |
Release Notes: |
|
||
API Changes: |
|
||
Internal Changes: |
Description
Currently, Trac starts to response after entire of content is generated from genshi template. Users have a long wait for the response because the rendering is not fast. Especially, timeline and query pages are very slow when the page has many entries.
If Trac starts to response without waiting for entire of content, it would feel a bit fast to users.
In chunked-encoding.diff, Request.send
accepts an iterable instance. The patch for 0.12.x is used in our Trac hosting.
Drawback of the changes is that exception while rendering the template cannot be shown as internal error.
Also, it is less improved in wiki page. Because wiki formatter format_to_*
methods return entire of generated content. It needs to modify the methods returning content as iterable.
Change History (11)
by , 10 years ago
Attachment: | chunked-encoding.diff added |
---|
comment:1 by , 10 years ago
Cc: | added |
---|
comment:2 by , 10 years ago
comment:3 by , 10 years ago
Milestone: | next-stable-1.0.x → 1.0.3 |
---|---|
Owner: | set to |
Status: | new → assigned |
I want to add the ability. Sending content as chunked-encoding would feel fast-response to users for large file in browser page, large diff in changeset page, many entries in timeline page and many tickets in query page.
jomae.git@t11802 includes the following changes.
- Add
[trac] use_chunked_encoding
option.- If disabled, Trac sends response with Content-Length header without chunked-encoding (default).
- If enabled, Trac sends response with chunked-encoding.
Request.write()
andRequest.send()
accept an iterable instance.- Add
iterable
parameter toChrome.render_template()
to retrieve content of genshi rendering as an iterable instance. - Add
Chrome.iterable_content()
method which retrieves an iterable instance from a Genshi stream instance. - Allow to return an iterable instance from
IContentConverter.convert_content()
.
Thoughts?
comment:5 by , 10 years ago
A logical continuation of the work started in #717. Give me some time to review and test.
comment:6 by , 9 years ago
Milestone: | 1.0.3 → 1.0.4 |
---|
comment:7 by , 9 years ago
Milestone: | 1.0.4 → 1.0.5 |
---|
comment:8 by , 9 years ago
Milestone: | 1.0.5 → 1.0.6 |
---|
I'll retest and push it at the start of 1.0.6 if no objections.
comment:10 by , 9 years ago
Updated jomae.git@t11802. Added unit tests and confirmed ontracd
and Apache2 with mod_wsgi.
Proposed changes in jomae.git@t11802, applied the patch and added
[trac] use_chunked_encoding
option.