seo_cache 1.0.5 → 1.0.6

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: 36c446ef0dc5b6781157d81939f519c60e024ef6b4b0a9709b23f71cf2a96684
4
- data.tar.gz: 73f5a4fe10538b1292e8482d82f7411da4380ded38bcb13ba3b1565a3267576e
3
+ metadata.gz: 470c0f8bf9bee91e738987dd31618d612d4f8007fe5d486bce1c4d7c0f1053de
4
+ data.tar.gz: cc0bb416f7893fb08a97e845635c374bf8dbc846127724077729d6870ceb93ec
5
5
  SHA512:
6
- metadata.gz: 7e4f9582ca1e55fabd778adedec0cef4f715ea8fa78e3be1fc85a3982f2e4c8a48dfa8954154208735d5a7daf02c7f8da682c8b5f96d008bf5f8a829706d2f77
7
- data.tar.gz: 2c6c965ec2cb3621f10e91f8cc75bad2d032825dfebe629cf0a023a74382b3676550f9060c68deb110b21429381e5e4127938c2b5aa2da839925436e7ec32ccc
6
+ metadata.gz: 6057c2afeb50daf1a93c1df0e9f6c90d55be66688445a417dca2d6b434d0dfc587e487be4d4404d3897c783f0e3d3d2880d5f9b6524b35975e5c87031028e4c2
7
+ data.tar.gz: 5822d662fdbbf6d2c47bb21ed627697c52760e6133eff49978f11c3ad6fd984cb0b67c8b6e778e6bc43742a2ba2241bdf81d24f810333e92be60c840d159559c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.0.6
2
+
3
+ - Logs only missed cache for success response
4
+
1
5
  ## 1.0.5
2
6
 
3
7
  - Use correct path for index page with multiple domain names
@@ -36,9 +36,15 @@ module SeoCache
36
36
  else
37
37
  Thread.new do
38
38
  prerender_data = page_render(env)
39
- # Extract status from render page or return 404
40
- status = prerender_data&.scan(/<!--status:(\d+)-->/)&.last&.first
41
- after_render(env, prerender_data, status || 200)
39
+ # Extract status from render page or return success (200)
40
+ status = prerender_data&.scan(/<!--status:(\d+)-->/)&.last&.first || 200
41
+
42
+ if SeoCache.log_missed_cache && status.to_s.start_with?('2')
43
+ env_request = Rack::Request.new(env)
44
+ SeoCache.log("missed cache : #{env_request.path} (User agent: #{env_request.user_agent})")
45
+ end
46
+
47
+ after_render(env, prerender_data, status)
42
48
  end
43
49
  end
44
50
  elsif prerender_params?(env)
@@ -94,7 +100,7 @@ module SeoCache
94
100
  return false if SeoCache.blacklist_params.present? && SeoCache.blacklist_params.any? { |param| query_params.has_key?(param) }
95
101
 
96
102
  # if it is a bot and is requesting a resource...don't prerender
97
- return false if @extensions_to_ignore.any? { |extension| request.fullpath.include? extension }
103
+ return false if @extensions_to_ignore.any? { |extension| request.fullpath.include?(extension) }
98
104
 
99
105
  # if it is a bot and not requesting a resource and is not whitelisted...don't prerender
100
106
  return false if SeoCache.whitelist_urls.present? && SeoCache.whitelist_urls.all? { |whitelisted| !Regexp.new(whitelisted).match(request.fullpath) }
@@ -1,3 +1,3 @@
1
1
  module SeoCache
2
- VERSION = '1.0.5'.freeze
2
+ VERSION = '1.0.6'.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.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - FloXcoder
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-23 00:00:00.000000000 Z
11
+ date: 2021-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack