mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-25 17:56:34 +08:00
4b1b329edb
* 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. |
||
---|---|---|
.. | ||
basicauth | ||
bind | ||
browse | ||
errors | ||
expvar | ||
extensions | ||
fastcgi | ||
gzip | ||
header | ||
httpserver | ||
index | ||
internalsrv | ||
limits | ||
log | ||
markdown | ||
mime | ||
pprof | ||
proxy | ||
push | ||
redirect | ||
requestid | ||
rewrite | ||
root | ||
staticfiles | ||
status | ||
templates | ||
timeouts | ||
websocket | ||
caddyhttp_test.go | ||
caddyhttp.go |