I have a web.py program acting as a web service, delivering responses according to the files in its directory.
Now I want to build a network of servers, each running an instance of the program. Additionally, each server has a list of addresses to other servers.
The motivation behind this is to allow different servers to store different files, delivering a different part of the (now distributed) service.
So far so good, each server looks at its own files, does its thing to create the responses and then concatenates to that all responses he gets from his neighbors in the network.
The problem is that this can cause circular requests if two servers have each other on their list (directly or indirectly).
How can I prevent this? I was thinking about appending a list of server addresses to each request. A server will add itself to the list when receiving the request. It will only request a response from those neighbors that are not on the list already. Is this a feasible approach?
Is there something built into http (requests) to collect responses from several servers without creating endless loops?
Your approach should work. 
Might be faster to check if the server sees itself on the request list - that means it already processed that request thus all the other servers it has in its list should already be in the response list - no need to check each and every one of them. Or maybe use it as a redundant sanity check? Unless your system allows duplicate requests coming in simultaneously on multiple servers.
AFAIK HTTP handles only client/server (i.e. point to point) communications, in a 1:1 request/response model - no loops.
How can I prevent circular http requests in a network of servers?