我想保护一个后端服务器,让squid发送一个单一的请求到服务器,当一个资源caching未命中时。 在获取期间,其他请求应该被搁置,直到单个请求返回。
头文件stale-while-revalidate几乎是我想要的,但是当max-age和stale-while-revalidate都通过时,没有失效的响应,并且多个请求将被发送到后端。
指令collapsed_forwarding似乎正是我所期待的。 但是我无法按预期工作,仍然在最大时期内看到对后端的多重请求。 我正在testing这与SoapUI 5.2.1简单的负载testing与40个线程。
我目前的Squidconfiguration(3.5.19)是默认configuration,有以下更改:
#Queue incomming requests when a request is send to the backend. IE 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
请求URI: /rest/information/bridge/Test?isrs=AB12345
响应头Cache-Control no-transform, max-age=2
目前看来,不可能达到collapsed_rowarding反向代理的预期效果。 我已经在回复的鱿鱼邮件列表上(在发送一些日志logging之后)问这个问题:
折叠转发不适用于caching重新validation请求。 工厂正在实施折叠的重新validation(在某些环境中),但我无法承诺具体的交付date或您的特定环境将被覆盖。
查看邮件列表了解更多详情: http : //lists.squid-cache.org/pipermail/squid-users/2016-June/011021.html