idempo 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -1
- data/lib/idempo/version.rb +1 -1
- data/lib/idempo.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 057a7d3947de8a08ae62e9f7de2f2b05fae6607c1662aac78c7b12544050f41d
|
4
|
+
data.tar.gz: d0d8a84c2b208fd27b2301f975a3cf582d0c7b9e1b572d61574febf1f9f31cf4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb98caf618c0c0c8987de2bd3e9e3a277c0d23d72d7b24ae90c22a678e44675bfb5a23468d23d0b73e9ccc7ec8e90704df553852b72a346b4f28e00d7a441fcc
|
7
|
+
data.tar.gz: 4c66050b6e219abd0922bd9a3e72740344c78c65bf0d35af08e2f423f4f2b835da377662b785802a37db4806f996e565027f1e3bdceff9d5344d59fa03344930
|
data/README.md
CHANGED
@@ -32,9 +32,23 @@ use Idempo, backend: Idempo::RedisBackend.new(Rails.application.config.redis_con
|
|
32
32
|
and to initialize with a memory store as backend:
|
33
33
|
|
34
34
|
```ruby
|
35
|
-
use Idempo, backend: Idempo::MemoryBackend.new
|
35
|
+
use Idempo, backend: Idempo::MemoryBackend.new
|
36
36
|
```
|
37
37
|
|
38
|
+
In principle, the following requests qualify to be cached used the idempotency key:
|
39
|
+
|
40
|
+
* Any request which is not a `GET`, `HEAD` or `OPTIONS` and...
|
41
|
+
* Provides an `Idempotency-Key` or `X-Idempotency-Key` header
|
42
|
+
|
43
|
+
The default time for storing the cache is 30 seconds from the moment the request has finished generating. The response is going to be buffered, then serialized using msgpack, then deflated. Idempo will not cache the response if its size cannot be known in advance, and if the size of the response body exceeds a reasonable size (4 MB is our limit for the time being) - this is to prevent your storage from filling up with very large responses.
|
44
|
+
|
45
|
+
## Controlling the behavior of Idempo
|
46
|
+
|
47
|
+
You can control the behavior of Idempo using special headers:
|
48
|
+
|
49
|
+
* Set `X-Idempo-Policy` to `no-store` to disable retention of the response even though it otherwise could be cached
|
50
|
+
* Set `X-Idempo-Persist-For-Seconds` to decimal number of seconds to store your response fo
|
51
|
+
|
38
52
|
## Development
|
39
53
|
|
40
54
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/idempo/version.rb
CHANGED
data/lib/idempo.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: idempo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julik Tarkhanov
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-10-
|
12
|
+
date: 2021-10-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|