WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/content/middleware/timeout.md
+99-27Lines changed: 99 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,48 +8,62 @@ description = "Timeout middleware for Echo"
8
8
9
9
Timeout middleware is used to timeout at a long running operation within a predefined period.
10
10
11
+
When timeout occurs, and the client receives timeout response the handler keeps running its code and keeps using resources until it finishes and returns!
12
+
13
+
> Timeout middleware is a serious performance hit as it buffers all responses from wrapped handler. Do not set it in front of file downloads or responses you want to stream to the client.
14
+
15
+
Timeout middleware is not a magic wand to hide slow handlers from clients. Consider designing/implementing asynchronous
16
+
request/response API if (extremely) fast responses are to be expected and actual work can be done in background
17
+
Prefer handling timeouts in handler functions explicitly
0 commit comments