|
8 | 8 | 3. [Cache system](#cache-system)
|
9 | 9 | 4. [Exemples](#exemples)
|
10 | 10 | 4.1. [Træfik container](#træfik-container)
|
| 11 | +5. [SSL](#ssl) |
| 12 | + 5.1. [Træfik](#træfik) |
11 | 13 |
|
12 | 14 | [](https://travis-ci.com/Darkweak/Souin)
|
13 | 15 |
|
14 | 16 | # <img src="docs/img/logo.svg?sanitize=true" alt="Souin logo" width="30" height="30">ouin reverse-proxy cache
|
15 | 17 |
|
16 | 18 | ## Project description
|
17 |
| -Souin is a new cache system for every reverse-proxy. It will be placed on top of your reverse-proxy like Apache, NGinx or Traefik. |
18 |
| -As it's written in go, it can be deployed on any server and with docker integration, it will be easy to implement it on top of Swarm or kubernetes instance. |
| 19 | +Souin is a new cache system any every reverse-proxy. It will be placed on top of your current reverse-proxy whether it's Apache, nginx or Traefik. |
| 20 | +Since it's written in go, it can be deployed on any server and thantks docker integration, it will be easy to install it on top of a Swarm or a kubernetes instance. |
19 | 21 |
|
20 | 22 | ## Environment variables
|
21 | 23 |
|
22 | 24 | ### Required variables
|
23 | 25 | | Variable | Description | Value exemple |
|
24 | 26 | |:---:|:---:|:---:|
|
25 |
| -|`CACHE_PORT`|The HTTP port Souin will be running to|`80`| |
26 |
| -|`CACHE_TLS_PORT`|The TLS port Souin will be running to|`443`| |
| 27 | +|`CACHE_PORT`|The HTTP port Souin will be listening on |`80`| |
| 28 | +|`CACHE_TLS_PORT`|The TLS port Souin will be listening on|`443`| |
27 | 29 | |`REDIS_URL`|The redis instance URL|- `http://redis` (Container way)<br/>`http://localhost:6379` (Local way)|
|
28 | 30 | |`TTL`|Duration to cache request (in seconds)|10|
|
29 |
| -|`REVERSE_PROXY`|The reverse-proxy instance URL like Apache, Nginx, Træfik, etc...|- `http://yourservice` (Container way)<br/>`http://localhost:81` (Local way)| |
| 31 | +|`REVERSE_PROXY`|The reverse-proxy's instance URL (Apache, Nginx, Træfik...)|- `http://yourservice` (Container way)<br/>`http://localhost:81` (Local way)| |
30 | 32 |
|
31 | 33 | ### Optional variables
|
32 | 34 | | Variable | Description | Value exemple |
|
33 | 35 | |:---:|:---:|:---:|
|
34 |
| -|`REGEX`|The regex to define URL to not store in cache|`http://domain.com/mypath`| |
| 36 | +|`REGEX`|The regex that matches URLs not to store in cache|`http://domain.com/mypath`| |
35 | 37 |
|
36 | 38 | ## Cache system
|
37 |
| -The cache is set into redis instance, because we can set, get, update and delete keys as easy as possible. |
38 |
| -To perform with that, redis should be on the same network than Souin instance if you are using docker-compose, then both should be on the same server if you use binaries |
39 |
| -Asynchronously, Souin will request redis instance and the reverse-proxy to get at least one valid response and return to the client the first response caught by Souin. |
| 39 | +The cache sits into a Redis instance, because setting, getting, updating and deleting keys in Redis is as easy as it gets. |
| 40 | +In order to do that, Redis should be on the same network than the Souin instance when using docker-compose. When yousing binaries, then both should be on the same server. |
| 41 | +Souin will return the redis instance when it gives a valid answer, or fallback to the reverse proxy otherwise. |
40 | 42 |
|
41 | 43 | ### Cache invalidation
|
42 |
| -The cache invalidation is made for CRUD requests, if you're doing a GET HTTP request, it will serve the cached response if exists then the reverse-proxy response will be served. |
43 |
| -If you're doing a POST, PUT, PATCH or DELETE HTTP request, the related cached get request will be dropped and the list endpoint will be dropped too |
44 |
| -It works very well with plain [API Platform](https://api-platform.com) integration (but not custom actions for now) and CRUD routes |
| 44 | +The cache invalidation is made for CRUD requests, if you're doing a GET HTTP request, it will serve the cached response when it exists, otherwise the reverse-proxy response will be served. |
| 45 | +If you're doing a POST, PUT, PATCH or DELETE HTTP request, the related cache GET request will be dropped and the list endpoint will be dropped too |
| 46 | +It works very well with plain [API Platform](https://api-platform.com) integration (not for custom actions for now) and CRUD routes. |
45 | 47 |
|
46 | 48 | ## Exemples
|
47 | 49 |
|
48 | 50 | ### Træfik container
|
49 |
| -[Træfik](https://traefik.io) is a modern reverse-proxy and help you to manage full container architecure projects. |
| 51 | +[Træfik](https://traefik.io) is a modern reverse-proxy and help you to manage full container architecture projects. |
50 | 52 |
|
51 | 53 | ```yaml
|
52 | 54 | # your-traefik-instance/docker-compose.yml
|
@@ -116,11 +118,11 @@ networks:
|
116 | 118 | ## SSL
|
117 | 119 |
|
118 | 120 | ### Træfik
|
119 |
| -As Souin is compatible with Træfik, it can use (and it should use) acme.json provided on træfik. Souin will get new/updated certs from Træfik, then your SSL certs will be up to date as far as Træfik will be too |
120 |
| -To provide, acme, use just have to map volume as above |
| 121 | +As Souin is compatible with Træfik, it can use (and it should use) the acme.json provided by træfik. Souin will fetch his certs from Træfik, meaning that as soon as Træfik has renewed SSL certificates, Soin will use them too. |
| 122 | +To provide the file, you just have to map volume as above |
121 | 123 | ```yaml
|
122 | 124 | volumes:
|
123 | 125 | - /anywhere/acme.json:/app/src/github.com/darkweak/souin/acme.json
|
124 | 126 | ```
|
125 |
| -At the moment you can't choose the path for the acme.json in the container, in the future you'll be able to do that just setting one env var |
126 |
| -If none acme.json is provided to container, a default cert will be served. |
| 127 | +At the moment you can't customize the path for the acme.json in the container, but in the future you'll be able to do that just by setting an env var |
| 128 | +If no acme.json is provided to the container, a default cert will be served. |
0 commit comments