1

I would like to protect a backend server by having Squid send a single request to a the server when there is a cache miss for a resource. During the fetching, other requests should be put on hold until the single requests returns.

The header stale-while-revalidate almost does what I want, however when both the times of max-age and stale-while-revalidate have passed there is no stale response and multiple requests will be send to the backend.

The directive collapsed_forwarding seems to be exactly what i'm looking for. But i'm unable to get this to work as expected, still seeing multiple request to the backend within the max-age period. I'm testing this with SoapUI 5.2.1 Simple Load Test with 40 threads.

My current configuration for Squid (3.5.19) is the default configuration with the following changes:

#Queue incomming requests when a request is send to the backend. I.E. collapse request into a single backend request.
collapsed_forwarding on

# Squid normally listens to port 3128
http_port 3128 accel no-vhost defaultsite=localhost ignore-cc

#Backend requires basic auth
cache_peer 127.0.0.1 parent 53142 0 no-query originserver name=myAccel login=username:password

#Allow caching of files that have a ttl of 1 seconds
minimum_expiry_time 1 seconds

acl our_sites dstdomain localhost
http_access allow our_sites
cache_peer_access myAccel allow our_sites
cache_peer_access myAccel deny all

Request URI: /rest/information/bridge/Test?isrs=AB12345

Response header Cache-Control no-transform, max-age=2

0

For now it appears to be impossible to achieve the desired effect of collapsed_rowarding for reverse proxying. I've asked this question on the squid mailing list in which the reply was (after sending some logging):

Collapsed forwarding does not apply to cache revalidation requests yet. Factory is working on implementing collapsed revalidations (in some environments), but I cannot promise a specific delivery date or that your particular environment will be covered.

Check the mailinglist for more details: http://lists.squid-cache.org/pipermail/squid-users/2016-June/011021.html

|improve this answer|||||
  • Delivery date turned out to be this week. Squid-3.5.22 will have that feature. – Amos Jeffries Sep 28 '16 at 4:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.