api-response-cache 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/api_response_cache/api_cache_handler.rb +6 -1
- data/lib/api_response_cache/version.rb +1 -1
- 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: 16c4aae2148689e108dfcddc8ba1a82c5374b72f2c683a8e304e300ec66de6b6
|
4
|
+
data.tar.gz: ffafed6be7bb7f58c4efc5e465f49bcb99ee1800ec3ab8421bc474562850cd17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8af83ad6abebf7112dc329d77555260ff188edb5dd9fe8de11f858f4dfcd9a8bcee22d656d12e820f713e35ab18506a99f99d6f2a0c1210a7c880bbf8924afc5
|
7
|
+
data.tar.gz: d699ac309400e21efded32a189a08bd85cbbab8c3b37c9ed7958056c7696dbfb892668efe901675a179c927e3233bbf7e7c4624e58f776e33a3ea081d4e3a5a5
|
@@ -9,7 +9,7 @@ module ApiResponseCache
|
|
9
9
|
|
10
10
|
def around(controller)
|
11
11
|
init(controller)
|
12
|
-
if
|
12
|
+
if should_response_cache?
|
13
13
|
log_info
|
14
14
|
render_cached_response
|
15
15
|
else
|
@@ -20,6 +20,10 @@ module ApiResponseCache
|
|
20
20
|
|
21
21
|
protected
|
22
22
|
|
23
|
+
def should_response_cache?
|
24
|
+
@request.get? && @response_cache.present?
|
25
|
+
end
|
26
|
+
|
23
27
|
def log_info
|
24
28
|
processor = @processor_name.blue
|
25
29
|
responder = Rainbow('API Response Cache').green
|
@@ -64,3 +68,4 @@ module ApiResponseCache
|
|
64
68
|
end
|
65
69
|
end
|
66
70
|
end
|
71
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: api-response-cache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Uysim Ty
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-06-
|
11
|
+
date: 2018-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rainbow
|