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?