mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-01 21:24:23 +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. |
||
---|---|---|
.. | ||
condition_test.go | ||
condition.go | ||
error.go | ||
https_test.go | ||
https.go | ||
logger_test.go | ||
logger.go | ||
middleware_test.go | ||
middleware.go | ||
mitm_test.go | ||
mitm.go | ||
path_test.go | ||
path.go | ||
plugin_test.go | ||
plugin.go | ||
recorder_test.go | ||
recorder.go | ||
replacer_test.go | ||
replacer.go | ||
responsewriterwrapper.go | ||
roller.go | ||
server_test.go | ||
server.go | ||
siteconfig.go | ||
tplcontext_test.go | ||
tplcontext.go | ||
vhosttrie_test.go | ||
vhosttrie.go |