aboutsummaryrefslogtreecommitdiffstats
path: root/FLOW.md
blob: 7fd1f9bbc561faf0dddeec2f61b8aedeb51fbe61 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
pacredir - request flow
=======================

[◀ Go back to main README](README.md)

Whenever `pacman` sends a request to `pacredir` a number of requests
(increasing with the number of hosts found) is sent through the network.
Let's assume `pacredir` knows about two hosts.

OK - serving from local network
-------------------------------

In this exemple one hast (`host A`) is missing the file, but second
one (`host B`) does have the file.

For database files the decision on what return code (`307` vs. `404`) to
send is made on the file age. The local file's timestamp is compared to
what timestamp `pacman` sends in its request.

![OK - serving from local network](FLOW/ok.svg)

After the initial request `pacman` is redirected to `host B` and gets the
file there. No request is sent to the mirror.

FAIL - fallback to mirror
-------------------------

In this example no host has the file or the local database files are older
than what `pacman` requested.

![FAIL - fallback to mirror](FLOW/fail.svg)

All requests made by `pacredir` are answered with http code `404`, thus
`pacman` receives the same. Finally `pacman` falls back to the next mirror.

---
[◀ Go back to main README](README.md)  
[▲ Go back to top](#top)