seo_cache 0.4.0 → 0.5.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: 71f9d913131751f275f89dc2dfaa5efa2c7a7459b6a086c16129576bac9a202e
4
- data.tar.gz: 4977d0738e9b3f2012e3759326c010be91c48d081e3f470eb4d002fc7daf9541
3
+ metadata.gz: 3f1581fe41f35bbe7045888252f0f1e79b3943bf05875f7e1e9410484e561fab
4
+ data.tar.gz: 3daf9c83a4bfa21aaec62170f2ac61c77e337c7a94661335f17ec056c53494f4
5
5
  SHA512:
6
- metadata.gz: 6ddf8e5685420b8a12a50f81846bef821687b9d58757ceb93bc4aae6b177390bf3ca965bbcf4ace82b1407296a06e24220f66fa933162006da4e891c05fe9c2b
7
- data.tar.gz: 755dd4c9e0e210e215c41eca0451c5f7c9b1385238a1169d1b739cbb1b5c25de71d55e9f6fe0119e46361b805df2e7ac769b81679b509063727e8af443c160db
6
+ metadata.gz: fec66b4c726578b2558c8f3119af5fe4459206faa510909ba670d63cd3768d157240527c46a3d438f0a3dd58e27a1432e537c67cb0dc2c75075a3729eb1727a5
7
+ data.tar.gz: 107984a8d01f3e09279f87cff010395301ab11b6d09f38237288b6e0eb7284fd1d3001318fd7a5cc04a32ceecf043e63ac108e4ce28d79f0b840ce9a0221b061
data/.rubocop.yml CHANGED
@@ -26,10 +26,10 @@ Layout/ExtraSpacing:
26
26
  Enabled: false
27
27
  AllowForAlignment: true
28
28
 
29
- Layout/FirstParameterIndentation:
29
+ Layout/IndentFirstHashElement:
30
30
  Enabled: false
31
31
 
32
- Layout/IndentHash:
32
+ Layout/IndentFirstArgument:
33
33
  Enabled: false
34
34
 
35
35
  Layout/LeadingCommentSpace:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.5.0
2
+
3
+ - Add more information in README
4
+ - Update gems and define cache time for browser driver
5
+
1
6
  ## 0.4.0
2
7
 
3
8
  - Complete README
data/README.md CHANGED
@@ -128,6 +128,18 @@ Be aware, JS will be render twice: once by server rendering and once by client.
128
128
 
129
129
  Disk cache is recommended by default. Nginx will directly fetch file on disk. The TTFB (time to first byte) will be under 200ms :). You can use memory cache if you have lot of RAM.
130
130
 
131
+ ## Consult cache pages
132
+
133
+ Too see in browser the cache page, open a browser and set the user agent to:
134
+
135
+ `Googlebot (Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html))`
136
+
137
+ For instance, with Chrome or Chromium, you can change the user agent in "Network conditions" panel.
138
+
139
+ To (re)cache a page, add this parameter to the url (the browser must use the Googlebot user agent):
140
+
141
+ `/?_seo_cache_=true`
142
+
131
143
  ## Automatic caching
132
144
 
133
145
  To automate caching, create a cron rake task (e.g. in `lib/tasks/populate_seo_cache.rake`):
@@ -158,6 +170,9 @@ location / {
158
170
  if ($arg_page) {
159
171
  break;
160
172
  }
173
+ if ($arg__seo_cache_) {
174
+ break;
175
+ }
161
176
 
162
177
  # cached pages
163
178
  set $cache_extension '';
@@ -83,6 +83,8 @@ module SeoCache
83
83
  end
84
84
  return false if blacklisted_url
85
85
 
86
+ SeoCache.log('force cache : ' + request.path) if Rack::Utils.parse_query(request.query_string).has_key?(SeoCache.force_cache_url_param) && SeoCache.log_missed_cache
87
+
86
88
  return is_requesting_prerendered_page
87
89
  end
88
90
 
@@ -33,6 +33,8 @@ module SeoCache
33
33
  def init_driver
34
34
  # Selenium::WebDriver.logger.level = :info
35
35
 
36
+ Webdrivers.cache_time = 86_400
37
+
36
38
  Selenium::WebDriver::Chrome.path = SeoCache.chrome_path if SeoCache.chrome_path
37
39
 
38
40
  client = ::Selenium::WebDriver::Remote::Http::Persistent.new
@@ -1,3 +1,3 @@
1
1
  module SeoCache
2
- VERSION = '0.4.0'.freeze
2
+ VERSION = '0.5.0'.freeze
3
3
  end
data/seo_cache.gemspec CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.add_dependency 'railties', '~> 5'
27
27
  spec.add_dependency 'redis', '~> 4'
28
28
  spec.add_dependency 'redis-namespace', '~> 1'
29
- spec.add_dependency 'selenium-webdriver', '~> 3'
29
+ spec.add_dependency 'selenium-webdriver', '3.141.0' # 3.142 is bugged
30
30
  spec.add_dependency 'webdrivers', '~> 3'
31
31
 
32
32
  spec.add_development_dependency 'bundler', '~> 1'
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.4.0
4
+ version: 0.5.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-04-10 00:00:00.000000000 Z
11
+ date: 2019-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -98,16 +98,16 @@ dependencies:
98
98
  name: selenium-webdriver
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: '3'
103
+ version: 3.141.0
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: '3'
110
+ version: 3.141.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: webdrivers
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -240,7 +240,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
240
240
  - !ruby/object:Gem::Version
241
241
  version: '0'
242
242
  requirements: []
243
- rubygems_version: 3.0.3
243
+ rubyforge_project:
244
+ rubygems_version: 2.7.9
244
245
  signing_key:
245
246
  specification_version: 4
246
247
  summary: Cache dedicated for SEO with Javascript rendering