You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
21
+
Souin is a new cache system suitable for every reverse-proxy. It will be placed on top of your current reverse-proxy whether it's Apache, Nginx or Traefik.
22
+
As it's written in go, it can be deployed on any server and thanks docker integration, it will be easy to install it on top of a Swarm or a kubernetes instance.
21
23
22
24
## Environment variables
23
25
24
26
### Required variables
25
-
| Variable | Description | Value exemple|
27
+
| Variable | Description | Value example|
26
28
|:---:|:---:|:---:|
27
29
|`CACHE_PORT`|The HTTP port Souin will be listening on |`80`|
28
30
|`CACHE_TLS_PORT`|The TLS port Souin will be listening on|`443`|
@@ -31,21 +33,26 @@ Since it's written in go, it can be deployed on any server and thantks docker in
|`REGEX`|The regex that matches URLs not to store in cache|`http://domain.com/mypath`|
37
39
38
-
## Cache system
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.
The cache system sits on two providers at the moment. It provides an in-memory and redis cache systems because setting, getting, updating and deleting keys in Redis is as easy as it gets.
47
+
In order to do that, Redis could be on the same network than the Souin instance when using docker-compose or over the internet then it will use by default in-memory to avoid network latency as much as possible.
48
+
Souin will return at first the in-memory response when it gives a non-empty response, then the redis one will be used with same condition, or fallback to the reverse proxy otherwise.
42
49
43
50
### Cache invalidation
44
51
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
52
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
53
It works very well with plain [API Platform](https://api-platform.com) integration (not for custom actions for now) and CRUD routes.
47
54
48
-
## Exemples
55
+
## Examples
49
56
50
57
### Træfik container
51
58
[Træfik](https://traefik.io) is a modern reverse-proxy and help you to manage full container architecture projects.
@@ -125,16 +133,25 @@ To provide, acme, use just have to map volume as above
125
133
- /anywhere/traefik.json:/ssl/traefik.json
126
134
```
127
135
### Apache
128
-
Souin will listen `apache.json` file. You have to setup your own way to agregate your SSL cert files and keys. Alternatively you can use a side project called [dob](https://github.com/darkweak/dob), it's open-source and written in go too
136
+
Souin will listen `apache.json` file. You have to setup your own way to aggregate your SSL cert files and keys. Alternatively you can use a side project called [dob](https://github.com/darkweak/dob), it's open-source and written in go too
129
137
```yaml
130
138
volumes:
131
139
- /anywhere/apache.json:/ssl/apache.json
132
140
```
133
141
### Nginx
134
-
Souin will listen `nginx.json` file. You have to setup your own way to agregate your SSL cert files and keys. Alternatively you can use a side project called [dob](https://github.com/darkweak/dob), it's open-source and written in go too
142
+
Souin will listen `nginx.json` file. You have to setup your own way to aggregate your SSL cert files and keys. Alternatively you can use a side project called [dob](https://github.com/darkweak/dob), it's open-source and written in go too
135
143
```yaml
136
144
volumes:
137
145
- /anywhere/nginx.json:/ssl/nginx.json
138
146
```
139
147
At the moment you can't choose the path for the `*.json` in the container, they have to be placed in the `/ssl` folder. In the future you'll be able to do that just setting one env var
140
148
If none `*.json` is provided to container, a default cert will be served.
149
+
150
+
151
+
## Credits
152
+
153
+
Thanks to these users for contributing or helping this project in any way
0 commit comments