File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,10 @@ class HttpDispatcher
71
71
* If you specify a custom HTTP client, make sure that it converts HTTP
72
72
* errors to exceptions.
73
73
*
74
+ * If your proxy server IPs can not be statically configured, extend this
75
+ * class and overwrite getServers. Be sure to have some caching in
76
+ * getServers.
77
+ *
74
78
* @param string[] $servers Caching proxy server hostnames or IP
75
79
* addresses, including port if not port 80.
76
80
* E.g. ['127.0.0.1:6081']
@@ -170,6 +174,16 @@ public function flush()
170
174
return count ($ queue );
171
175
}
172
176
177
+ /**
178
+ * Get the list of servers to send invalidation requests to.
179
+ *
180
+ * @return UriInterface[]
181
+ */
182
+ protected function getServers ()
183
+ {
184
+ return $ this ->servers ;
185
+ }
186
+
173
187
/**
174
188
* Duplicate a request for each caching server.
175
189
*
@@ -214,7 +228,7 @@ private function fanOut(RequestInterface $request)
214
228
$ request = $ request ->withUri ($ uri )->withHeader ('Connection ' , 'Close ' );
215
229
216
230
// Create a request to each caching proxy server
217
- foreach ($ this ->servers as $ server ) {
231
+ foreach ($ this ->getServers () as $ server ) {
218
232
$ requests [] = $ request ->withUri (
219
233
$ uri
220
234
->withScheme ($ server ->getScheme ())
You can’t perform that action at this time.
0 commit comments