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 +4 -4
- data/.rubocop.yml +2 -2
- data/CHANGELOG.md +5 -0
- data/README.md +15 -0
- data/lib/seo_cache/middleware.rb +2 -0
- data/lib/seo_cache/page_render.rb +2 -0
- data/lib/seo_cache/version.rb +1 -1
- data/seo_cache.gemspec +1 -1
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f1581fe41f35bbe7045888252f0f1e79b3943bf05875f7e1e9410484e561fab
|
4
|
+
data.tar.gz: 3daf9c83a4bfa21aaec62170f2ac61c77e337c7a94661335f17ec056c53494f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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/
|
29
|
+
Layout/IndentFirstHashElement:
|
30
30
|
Enabled: false
|
31
31
|
|
32
|
-
Layout/
|
32
|
+
Layout/IndentFirstArgument:
|
33
33
|
Enabled: false
|
34
34
|
|
35
35
|
Layout/LeadingCommentSpace:
|
data/CHANGELOG.md
CHANGED
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 '';
|
data/lib/seo_cache/middleware.rb
CHANGED
@@ -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
|
data/lib/seo_cache/version.rb
CHANGED
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', '
|
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
|
+
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-
|
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:
|
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:
|
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
|
-
|
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
|