commit: 1d8f1fe0772736dd71219d244783c9d671dd7223
parent d7262f7d2232343e47c2206b134a7d794e35c505
Author: Mark Felder <feld@feld.me>
Date: Fri, 5 Feb 2021 13:32:21 -0600
Add a default rule to not attempt to cache any files larger than 50MB
This fixes connection failures when trying to retrieve large files.
It is less common in typical Pleroma usage, but it's possible to encounter
this on a cloud instance with lower memory.
Diffstat:
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/installation/pleroma.vcl b/installation/pleroma.vcl
@@ -59,6 +59,13 @@ sub vcl_backend_response {
set beresp.http.CR = beresp.http.content-range;
}
+ # Bypass cache for large files
+ # 50000000 ~ 50MB
+ if (std.integer(beresp.http.content-length, 0) > 50000000) {
+ set beresp.uncacheable = true;
+ return(deliver);
+ }
+
# Don't cache objects that require authentication
if (beresp.http.Authorization && !beresp.http.Cache-Control ~ "public") {
set beresp.uncacheable = true;