seo_cache 0.13.0 → 0.14.0

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: 7d7b514af393697e5456ae38428f5c981c98e55d3d597bb2ad5eecb87ee6b51f
4
- data.tar.gz: cfa601bcfc63dcf325fa3e5be89afb0eadeb23f89825d83ea9b798ceb526c653
3
+ metadata.gz: e4489f101114c4ab4c88d1328f3caa18a2b32d025e28a6d3dd0e635ab0732f2f
4
+ data.tar.gz: d24a3daad5ba14c90d7be285204e753ec3f25c8574f04a26a6e3d77298f83f78
5
5
  SHA512:
6
- metadata.gz: 130eef04e96ea002199c7056df916aa0480b609cb200ef600cf9e9ba4fc39960c35eec1aebef5081c4a777cb4ef893543a7299fccf0d4be273853c679922d0a0
7
- data.tar.gz: fd39028f3f8a578f30f17a3ef2cf638d821220bb32d8e18294173d3afdaf073d497f90c58f4f6eed1bb85a693737978d0bf39664d3423bc18eba98d3efe21521
6
+ metadata.gz: 9d9affe855d206a22002ad0ef1ef8257e0635fdd74fce95c92b3dd7b54e55a63e71bc09413f71cb79f1ee471386ee529a15bee9a7ec36f9a2ee9e7180aea3c95
7
+ data.tar.gz: 55e82b4cdf9cdc037acd8dbfe69a274508b8317b1b6d111d723a039d68011d5ad114abc3444b6a19ad391e376ccff5c25908f050cbfd3fbb4a10ae2ce6691496
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.14.0
2
+
3
+ - Change options from Chrome
4
+ - Correct bug when rendering a 404 page
5
+
1
6
  ## 0.13.0
2
7
 
3
8
  - Correct option for populate cache
@@ -33,8 +33,8 @@ module SeoCache
33
33
  else
34
34
  Thread.new do
35
35
  prerender_data = page_render(env)
36
- # Extract status from render page
37
- status = prerender_data&.scan(/<!--status:(\d+)-->/)&.last&.first
36
+ # Extract status from render page (return 500 if status cannot be found, some problems happen somewhere)
37
+ status = prerender_data&.scan(/<!--status:(\d+)-->/)&.last&.first || 500
38
38
  after_render(env, prerender_data, status || 200)
39
39
  end
40
40
  end
@@ -44,8 +44,12 @@ module SeoCache
44
44
  status, headers, response = @app.call(env)
45
45
  status_code = "<!--status:#{status}-->"
46
46
  # Cannot add at the top of file, Chrome removes leading comments...
47
- body_code = response.body.sub('<head>', "<head>#{status_code}")
48
- return [status, headers, [body_code]]
47
+ begin
48
+ body_code = response.body.sub('<head>', "<head>#{status_code}")
49
+ return [status, headers, [body_code]]
50
+ rescue
51
+ return [status, headers, [nil]]
52
+ end
49
53
  end
50
54
 
51
55
  return @app.call(env)
@@ -35,12 +35,16 @@ module SeoCache
35
35
  browser_options.args << 'disable-infobars'
36
36
  browser_options.args << '--headless'
37
37
  browser_options.args << '--no-sandbox'
38
+ browser_options.args << '--incognito'
38
39
  browser_options.args << '--disable-dev-shm-usage'
39
40
  browser_options.args << '--disable-gpu'
40
41
  browser_options.args << '--disable-web-security'
41
42
  browser_options.args << '--disable-extensions'
43
+ browser_options.args << '--disable-logging'
44
+ browser_options.args << '--disable-notifications'
45
+ browser_options.args << '--disable-sync'
42
46
  browser_options.args << '--window-size=1920x1080'
43
- browser_options.args << '--remote-debugging-port=3020'
47
+ #browser_options.args << '--remote-debugging-port=9222'
44
48
  @driver = ::Selenium::WebDriver.for(:chrome, options: browser_options)
45
49
  end
46
50
  end
@@ -1,3 +1,3 @@
1
1
  module SeoCache
2
- VERSION = '0.13.0'.freeze
2
+ VERSION = '0.14.0'.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: 0.13.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - FloXcoder
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-19 00:00:00.000000000 Z
11
+ date: 2020-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack