0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-23 22:27:38 -05:00
caddy/caddyhttp
Matt Holt 4b1b329edb templates: Execute template loaded by later middlewares (#1649)
* templates: Execute template loaded by later middlewares

This is the beginning of an attempt to make the staticfiles file server
the only middleware that hits the disk and loads content. This may have
unknown implications. But the goal is to reduce duplication without
sacrificing performance. (We now call ServeContent here.)

This change loses about 15% of the req/sec of the old way of doing it,
but this way is arguably more correct since the file server is good at
serving static files; duplicating that logic in every middleware that
needs to hit the disk is not practical.

* httpserver: Introduce ResponseRecorder as per Tw's suggestions

It implements io.ReaderFrom and has some allocation-reducing
optimizations baked into it

* templates: Increase execution speed by ~10-15% after perf regression

By using httpserver.ResponseBuffer, we can reduce allocations and still
get what we want. It's a little tricky but it works so far.
2017-08-24 07:13:53 -06:00
..
basicauth basicauth: remove magic number (#1760) 2017-07-12 19:32:24 -06:00
bind
browse browse: Support absolute and recursive directory symlinks 2017-08-12 19:29:43 +02:00
errors log,error: fix roller parser issue 2017-07-20 15:21:06 +08:00
expvar
extensions httpserver/all: Clean up and standardize request URL handling (#1633) 2017-05-01 23:11:10 -06:00
fastcgi Fix for #1788. Rearrange struct fields. 2017-07-28 17:33:40 +01:00
gzip gzip: change ETag to weak ETag after gzip 2017-07-14 11:48:34 +08:00
header ResponseWriterWrapper and HTTPInterfaces (#1644) 2017-05-05 09:42:06 -06:00
httpserver templates: Execute template loaded by later middlewares (#1649) 2017-08-24 07:13:53 -06:00
index caddyhttp: New index directive for alternate index file names (#1567) 2017-04-17 11:02:44 -06:00
internalsrv internal: Allow use for only X-Accel-Redir (closes #1020) 2017-08-09 10:36:54 -06:00
limits Vendor all dependencies (Warning: Huge changeset.) 2017-05-27 13:30:11 -06:00
log log,error: fix roller parser issue 2017-07-20 15:21:06 +08:00
markdown markdown: fix the real ineffectual assignments in test 2017-06-29 18:30:18 +08:00
mime gzip,mime: show response header instead of the request one in test message 2017-07-08 11:53:34 +08:00
pprof
proxy proxy: fix hang on chunked websocket server 2017-07-25 15:12:38 +08:00
push Push resources for indexFiles when surfing to directories 2017-07-24 12:36:07 +02:00
redirect httpserver/all: Clean up and standardize request URL handling (#1633) 2017-05-01 23:11:10 -06:00
requestid Rename directive requestid to request_id (#1757) 2017-07-10 14:47:48 -06:00
rewrite Changed IfCond to store the condition function and the compiled regular expression. 2017-08-03 11:59:30 +01:00
root fixing panic when root is symlink (#1429) 2017-02-15 22:02:51 -07:00
staticfiles staticfiles: fix handling of filenames that end with index file names (#1812) 2017-08-07 18:10:47 -06:00
status
templates templates: Execute template loaded by later middlewares (#1649) 2017-08-24 07:13:53 -06:00
timeouts
websocket
caddyhttp.go Create request_id directive #1590 (#1711) 2017-06-24 13:54:35 -07:00
caddyhttp_test.go Create request_id directive #1590 (#1711) 2017-06-24 13:54:35 -07:00