seo_cache 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4ee9a26729de232dd3907da2de2af951a5e911b4e4232de92859ca99fa43b0e5
4
- data.tar.gz: 2e156bc6455e91f2b401c48091c942e10b6ed8f3565982caa587a48409090df7
3
+ metadata.gz: dde4a37e1374c8be6416313e684356041177425e0cf5c2466d4fc7c60818626d
4
+ data.tar.gz: 9e5879c7af42860ff332e06eb36343cd650bf8a89c634b386a8073059d9c4aa2
5
5
  SHA512:
6
- metadata.gz: 2a67455edd4979de42d1ab769cc6dd3001c5ef65c5d453f7f10ab2dc566004ebd33967fafe02f3ce4ce50c8507b7eb811931a20812bb2c532101556e508fa4d8
7
- data.tar.gz: 56fb3ebc4e5dc8d5e40374445f11c49e0c048f2db5f30eeaaebac66388d62a0f59711d2f08c1050469a89727df1cef57792698551037cc28db6f099fd539522e
6
+ metadata.gz: a391af74f2c3d9848cce8bb4b1daa228c3296e019bed8ab1126dda1b9a52825351a885bfd9c2067671f8ff645a4bb7b88d36d1fb8298790e04c48e36ab93daf5
7
+ data.tar.gz: 8aa95c5b23d5120b1a5848d115ed3ceb75ec2019abaf507a7bcf076fa9d391ffe750f1750bbcc4b484d497303544f68ab33788a11bd88a6d1bc5c10aae95f682
@@ -1,3 +1,7 @@
1
+ ## 1.0.2
2
+
3
+ - Do not log missed cache for ignored statuses
4
+
1
5
  ## 1.0.1
2
6
 
3
7
  - Add user agent to missed caches
@@ -22,7 +22,7 @@ module SeoCache
22
22
  return cached_response.finish if cached_response.present?
23
23
 
24
24
  if SeoCache.log_missed_cache
25
- env_request = Rack::Request.new(env)
25
+ env_request = Rack::Request.new(env)
26
26
  SeoCache.log("missed cache : #{env_request.path} (User agent: #{env_request.user_agent})")
27
27
  end
28
28
 
@@ -36,8 +36,8 @@ module SeoCache
36
36
  else
37
37
  Thread.new do
38
38
  prerender_data = page_render(env)
39
- # Extract status from render page (return 500 if status cannot be found, some problems happen somewhere)
40
- status = prerender_data&.scan(/<!--status:(\d+)-->/)&.last&.first || 500
39
+ # Extract status from render page or return 404
40
+ status = prerender_data&.scan(/<!--status:(\d+)-->/)&.last&.first || 404
41
41
  after_render(env, prerender_data, status || 200)
42
42
  end
43
43
  end
@@ -207,6 +207,11 @@ module SeoCache
207
207
  def after_render(env, response, status = 200)
208
208
  return unless response && SeoCache.cache_only_status.include?(status.to_i)
209
209
 
210
+ if SeoCache.log_missed_cache
211
+ env_request = Rack::Request.new(env)
212
+ SeoCache.log("missed cache : #{env_request.path} (User agent: #{env_request.user_agent})")
213
+ end
214
+
210
215
  @page_caching.cache(response, Rack::Request.new(env).path)
211
216
  end
212
217
  end
@@ -1,3 +1,3 @@
1
1
  module SeoCache
2
- VERSION = '1.0.1'.freeze
2
+ VERSION = '1.0.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seo_cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - FloXcoder
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-11-16 00:00:00.000000000 Z
11
+ date: 2020-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack