Make lacquer cache a synthetic response for ESI crash

We use varnish 4 for ESI caching and handling. For ESI requests that return a 5XX backback error, we return an empty synthetic response.

This empty response should be cached for a few seconds, because currently every subsequent request to the same ESI goes to the backend again. This puts a lot of strain on our servers when the 5XX response reason is costly.

sub vcl_backend_error {
    ....
    if (isAnESI && beresp.status >= 500 && beresp.status <= 599) {
        synthetic({""});

        return(deliver);
    }
}

      

We tried adding a title Retry-After

to the answer, but that doesn't do the trick.

set beresp.http.Retry-After = "5";

      

+3
caching varnish-vcl esi


source to share


No one has answered this question yet

Check out similar questions:

4
Any relationship between parent request and ESI ancillary requests (varnish, need for session)?
4
Make Varnish Ignore Cookie Header Requests
2
What makes walk-through varnish
1
varnish 4 for caching from multiple servers with different content
0
Boundary Limit Includes one page?
0
Varnish ESI only includes work when the parent page is fetched from the backend
0
Lacquer key v4: incorrect backend health check
0
Cash polish - 403 cache response
0
Why varnish stops caching a 200 response after 500 errors
0
Return a synthetic response and then retrieve and cache the object in varnish?



All Articles
Loading...
X
Show
Funny
Dev
Pics