seo_cache 1.0.0 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +281 -10
- data/CHANGELOG.md +20 -0
- data/README.md +4 -0
- data/lib/seo_cache/middleware.rb +12 -4
- data/lib/seo_cache/page_caching.rb +11 -11
- data/lib/seo_cache/populate_cache.rb +27 -14
- data/lib/seo_cache/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36c446ef0dc5b6781157d81939f519c60e024ef6b4b0a9709b23f71cf2a96684
|
4
|
+
data.tar.gz: 73f5a4fe10538b1292e8482d82f7411da4380ded38bcb13ba3b1565a3267576e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e4f9582ca1e55fabd778adedec0cef4f715ea8fa78e3be1fc85a3982f2e4c8a48dfa8954154208735d5a7daf02c7f8da682c8b5f96d008bf5f8a829706d2f77
|
7
|
+
data.tar.gz: 2c6c965ec2cb3621f10e91f8cc75bad2d032825dfebe629cf0a023a74382b3676550f9060c68deb110b21429381e5e4127938c2b5aa2da839925436e7ec32ccc
|
data/.rubocop.yml
CHANGED
@@ -1,18 +1,20 @@
|
|
1
1
|
# Documentation
|
2
2
|
# https://github.com/bbatsov/rubocop/blob/master/config/default.yml
|
3
|
-
#
|
3
|
+
# http://rubocop.readthedocs.io/en/latest
|
4
|
+
|
5
|
+
require:
|
6
|
+
- rubocop-rails
|
7
|
+
- rubocop-rspec
|
8
|
+
- rubocop-performance
|
4
9
|
|
5
10
|
AllCops:
|
6
|
-
TargetRubyVersion:
|
11
|
+
TargetRubyVersion: 3.0
|
7
12
|
|
8
13
|
Bundler/OrderedGems:
|
9
14
|
Enabled: false
|
10
15
|
|
11
|
-
|
12
|
-
Enabled:
|
13
|
-
|
14
|
-
Layout/ParameterAlignment:
|
15
|
-
Enabled: false
|
16
|
+
Gemspec/DateAssignment:
|
17
|
+
Enabled: true
|
16
18
|
|
17
19
|
Layout/CaseIndentation:
|
18
20
|
Enabled: false
|
@@ -42,9 +44,15 @@ Layout/FirstArrayElementIndentation:
|
|
42
44
|
Layout/FirstHashElementIndentation:
|
43
45
|
Enabled: false
|
44
46
|
|
47
|
+
Layout/HashAlignment:
|
48
|
+
Enabled: false
|
49
|
+
|
45
50
|
Layout/LeadingCommentSpace:
|
46
51
|
Enabled: false
|
47
52
|
|
53
|
+
Layout/LineLength:
|
54
|
+
Enabled: false
|
55
|
+
|
48
56
|
Layout/MultilineBlockLayout:
|
49
57
|
Enabled: false
|
50
58
|
|
@@ -57,20 +65,73 @@ Layout/MultilineMethodCallIndentation:
|
|
57
65
|
Layout/MultilineOperationIndentation:
|
58
66
|
Enabled: false
|
59
67
|
|
68
|
+
Layout/ParameterAlignment:
|
69
|
+
Enabled: false
|
70
|
+
|
60
71
|
Layout/SpaceAroundOperators:
|
61
72
|
Enabled: false
|
62
73
|
|
74
|
+
Layout/SpaceBeforeBrackets:
|
75
|
+
Enabled: true
|
76
|
+
|
63
77
|
Layout/SpaceInLambdaLiteral:
|
64
78
|
Enabled: false
|
65
79
|
|
66
80
|
Layout/TrailingWhitespace:
|
67
81
|
Enabled: false
|
68
82
|
|
83
|
+
Lint/AmbiguousAssignment:
|
84
|
+
Enabled: true
|
85
|
+
|
69
86
|
Lint/AmbiguousBlockAssociation:
|
70
87
|
Enabled: false
|
71
88
|
|
89
|
+
Lint/DeprecatedConstants:
|
90
|
+
Enabled: true
|
91
|
+
|
92
|
+
Lint/DuplicateBranch:
|
93
|
+
Enabled: true
|
94
|
+
|
95
|
+
Lint/DuplicateRegexpCharacterClassElement:
|
96
|
+
Enabled: true
|
97
|
+
|
98
|
+
Lint/EmptyBlock:
|
99
|
+
Enabled: true
|
100
|
+
|
101
|
+
Lint/EmptyClass:
|
102
|
+
Enabled: true
|
103
|
+
|
104
|
+
Lint/LambdaWithoutLiteralBlock:
|
105
|
+
Enabled: true
|
106
|
+
|
107
|
+
Lint/NoReturnInBeginEndBlocks:
|
108
|
+
Enabled: true
|
109
|
+
|
110
|
+
Lint/NumberedParameterAssignment:
|
111
|
+
Enabled: true
|
112
|
+
|
113
|
+
Lint/OrAssignmentToConstant:
|
114
|
+
Enabled: true
|
115
|
+
|
116
|
+
Lint/RedundantDirGlobSort:
|
117
|
+
Enabled: true
|
118
|
+
|
119
|
+
Lint/SymbolConversion:
|
120
|
+
Enabled: true
|
121
|
+
|
122
|
+
Lint/ToEnumArguments:
|
123
|
+
Enabled: true
|
124
|
+
|
125
|
+
Lint/TripleQuotes:
|
126
|
+
Enabled: true
|
127
|
+
|
128
|
+
Lint/UnexpectedBlockArity:
|
129
|
+
Enabled: true
|
130
|
+
|
131
|
+
Lint/UnmodifiedReduceAccumulator:
|
132
|
+
Enabled: true
|
133
|
+
|
72
134
|
Metrics/AbcSize:
|
73
|
-
# The ABC size is a calculated magnitude, so this number can be a Fixnum or a Float.
|
74
135
|
Max: 240
|
75
136
|
|
76
137
|
Metrics/BlockLength:
|
@@ -80,14 +141,14 @@ Metrics/BlockNesting:
|
|
80
141
|
Max: 4
|
81
142
|
|
82
143
|
Metrics/ClassLength:
|
83
|
-
CountComments: false
|
144
|
+
CountComments: false
|
84
145
|
Max: 600
|
85
146
|
|
86
147
|
Metrics/CyclomaticComplexity:
|
87
148
|
Enabled: false
|
88
149
|
|
89
150
|
Metrics/MethodLength:
|
90
|
-
CountComments: false
|
151
|
+
CountComments: false
|
91
152
|
Max: 120
|
92
153
|
|
93
154
|
Metrics/PerceivedComplexity:
|
@@ -96,6 +157,168 @@ Metrics/PerceivedComplexity:
|
|
96
157
|
Naming/RescuedExceptionsVariableName:
|
97
158
|
Enabled: false
|
98
159
|
|
160
|
+
Performance/AncestorsInclude:
|
161
|
+
Enabled: true
|
162
|
+
|
163
|
+
Performance/BigDecimalWithNumericArgument:
|
164
|
+
Enabled: true
|
165
|
+
|
166
|
+
Performance/BlockGivenWithExplicitBlock:
|
167
|
+
Enabled: true
|
168
|
+
|
169
|
+
Performance/CollectionLiteralInLoop:
|
170
|
+
Enabled: true
|
171
|
+
|
172
|
+
Performance/ConstantRegexp:
|
173
|
+
Enabled: true
|
174
|
+
|
175
|
+
Performance/MapCompact:
|
176
|
+
Enabled: true
|
177
|
+
|
178
|
+
Performance/MethodObjectAsBlock:
|
179
|
+
Enabled: true
|
180
|
+
|
181
|
+
Performance/RedundantEqualityComparisonBlock:
|
182
|
+
Enabled: true
|
183
|
+
|
184
|
+
Performance/RedundantSortBlock:
|
185
|
+
Enabled: true
|
186
|
+
|
187
|
+
Performance/RedundantSplitRegexpArgument:
|
188
|
+
Enabled: true
|
189
|
+
|
190
|
+
Performance/RedundantStringChars:
|
191
|
+
Enabled: true
|
192
|
+
|
193
|
+
Performance/ReverseFirst:
|
194
|
+
Enabled: true
|
195
|
+
|
196
|
+
Performance/SortReverse:
|
197
|
+
Enabled: true
|
198
|
+
|
199
|
+
Performance/Squeeze:
|
200
|
+
Enabled: true
|
201
|
+
|
202
|
+
Performance/StringInclude:
|
203
|
+
Enabled: true
|
204
|
+
|
205
|
+
Performance/Sum:
|
206
|
+
Enabled: true
|
207
|
+
|
208
|
+
Rails/ActiveRecordCallbacksOrder:
|
209
|
+
Enabled: true
|
210
|
+
|
211
|
+
Rails/AfterCommitOverride:
|
212
|
+
Enabled: true
|
213
|
+
|
214
|
+
Rails/AttributeDefaultBlockValue:
|
215
|
+
Enabled: true
|
216
|
+
|
217
|
+
Rails/DynamicFindBy:
|
218
|
+
Enabled: false
|
219
|
+
|
220
|
+
Rails/FindBy:
|
221
|
+
Enabled: false
|
222
|
+
|
223
|
+
Rails/FindById:
|
224
|
+
Enabled: true
|
225
|
+
|
226
|
+
Rails/HasManyOrHasOneDependent:
|
227
|
+
Enabled: false
|
228
|
+
|
229
|
+
Rails/Inquiry:
|
230
|
+
Enabled: true
|
231
|
+
|
232
|
+
Rails/InverseOf:
|
233
|
+
Enabled: false
|
234
|
+
|
235
|
+
Rails/MailerName:
|
236
|
+
Enabled: true
|
237
|
+
|
238
|
+
Rails/MatchRoute:
|
239
|
+
Enabled: true
|
240
|
+
|
241
|
+
Rails/NegateInclude:
|
242
|
+
Enabled: true
|
243
|
+
|
244
|
+
Rails/Pluck:
|
245
|
+
Enabled: true
|
246
|
+
|
247
|
+
Rails/OutputSafety:
|
248
|
+
Enabled: false
|
249
|
+
|
250
|
+
Rails/PluckInWhere:
|
251
|
+
Enabled: true
|
252
|
+
|
253
|
+
Rails/RenderInline:
|
254
|
+
Enabled: true
|
255
|
+
|
256
|
+
Rails/RenderPlainText:
|
257
|
+
Enabled: true
|
258
|
+
|
259
|
+
Rails/ShortI18n:
|
260
|
+
Enabled: true
|
261
|
+
|
262
|
+
Rails/SkipsModelValidations:
|
263
|
+
Enabled: false
|
264
|
+
|
265
|
+
Rails/SquishedSQLHeredocs:
|
266
|
+
Enabled: true
|
267
|
+
|
268
|
+
Rails/UnknownEnv:
|
269
|
+
Enabled: false
|
270
|
+
|
271
|
+
Rails/Validation:
|
272
|
+
Enabled: false
|
273
|
+
|
274
|
+
Rails/WhereEquals:
|
275
|
+
Enabled: true
|
276
|
+
|
277
|
+
Rails/WhereExists:
|
278
|
+
Enabled: true
|
279
|
+
|
280
|
+
Rails/WhereNot:
|
281
|
+
Enabled: true
|
282
|
+
|
283
|
+
RSpec/BeforeAfterAll:
|
284
|
+
Enabled: false
|
285
|
+
|
286
|
+
RSpec/ContextWording:
|
287
|
+
Enabled: false
|
288
|
+
|
289
|
+
RSpec/DescribedClass:
|
290
|
+
Enabled: false
|
291
|
+
|
292
|
+
RSpec/ExampleLength:
|
293
|
+
Max: 20
|
294
|
+
|
295
|
+
RSpec/Capybara:
|
296
|
+
Enabled: false
|
297
|
+
|
298
|
+
RSpec/ImplicitExpect:
|
299
|
+
Enabled: false
|
300
|
+
|
301
|
+
RSpec/ImplicitSubject:
|
302
|
+
Enabled: false
|
303
|
+
|
304
|
+
RSpec/InstanceVariable:
|
305
|
+
Enabled: false
|
306
|
+
|
307
|
+
RSpec/LeadingSubject:
|
308
|
+
Enabled: false
|
309
|
+
|
310
|
+
RSpec/MultipleExpectations:
|
311
|
+
Max: 10
|
312
|
+
|
313
|
+
RSpec/MultipleMemoizedHelpers:
|
314
|
+
Max: 8
|
315
|
+
|
316
|
+
RSpec/NestedGroups:
|
317
|
+
Max: 4
|
318
|
+
|
319
|
+
Style/ArgumentsForwarding:
|
320
|
+
Enabled: true
|
321
|
+
|
99
322
|
Style/AsciiComments:
|
100
323
|
Enabled: false
|
101
324
|
|
@@ -105,24 +328,63 @@ Style/BlockDelimiters:
|
|
105
328
|
Style/ClassAndModuleChildren:
|
106
329
|
Enabled: false
|
107
330
|
|
331
|
+
Style/CollectionCompact:
|
332
|
+
Enabled: true
|
333
|
+
|
108
334
|
Style/ColonMethodCall:
|
109
335
|
Enabled: false
|
110
336
|
|
111
337
|
Style/CommandLiteral:
|
112
338
|
Enabled: false
|
113
339
|
|
340
|
+
Style/Documentation:
|
341
|
+
Enabled: false
|
342
|
+
|
343
|
+
Style/DocumentDynamicEvalDefinition:
|
344
|
+
Enabled: true
|
345
|
+
|
114
346
|
Style/DoubleNegation:
|
115
347
|
Enabled: false
|
116
348
|
|
349
|
+
Style/EndlessMethod:
|
350
|
+
Enabled: true
|
351
|
+
|
117
352
|
Style/GlobalVars:
|
118
353
|
Enabled: false
|
119
354
|
|
355
|
+
Style/HashConversion:
|
356
|
+
Enabled: true
|
357
|
+
|
358
|
+
Style/HashEachMethods:
|
359
|
+
Enabled: true
|
360
|
+
|
361
|
+
Style/HashExcept:
|
362
|
+
Enabled: true
|
363
|
+
|
364
|
+
Style/HashTransformKeys:
|
365
|
+
Enabled: true
|
366
|
+
|
367
|
+
Style/HashTransformValues:
|
368
|
+
Enabled: true
|
369
|
+
|
370
|
+
Style/IfUnlessModifier:
|
371
|
+
Enabled: false
|
372
|
+
|
373
|
+
Style/IfWithBooleanLiteralBranches:
|
374
|
+
Enabled: true
|
375
|
+
|
120
376
|
Style/Lambda:
|
121
377
|
Enabled: false
|
122
378
|
|
123
379
|
Style/MultilineIfModifier:
|
124
380
|
Enabled: false
|
125
381
|
|
382
|
+
Style/NegatedIfElseCondition:
|
383
|
+
Enabled: true
|
384
|
+
|
385
|
+
Style/NilLambda:
|
386
|
+
Enabled: true
|
387
|
+
|
126
388
|
Style/NumericPredicate:
|
127
389
|
Enabled: false
|
128
390
|
|
@@ -130,6 +392,9 @@ Style/RedundantReturn:
|
|
130
392
|
Enabled: false
|
131
393
|
AllowMultipleReturnValues: true
|
132
394
|
|
395
|
+
Style/RedundantArgument:
|
396
|
+
Enabled: true
|
397
|
+
|
133
398
|
Style/RedundantSelf:
|
134
399
|
Enabled: false
|
135
400
|
|
@@ -139,5 +404,11 @@ Style/RegexpLiteral:
|
|
139
404
|
Style/RescueModifier:
|
140
405
|
Enabled: false
|
141
406
|
|
407
|
+
Style/StringChars:
|
408
|
+
Enabled: true
|
409
|
+
|
410
|
+
Style/SwapValues:
|
411
|
+
Enabled: true
|
412
|
+
|
142
413
|
Style/SymbolArray:
|
143
414
|
Enabled: false
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
## 1.0.5
|
2
|
+
|
3
|
+
- Use correct path for index page with multiple domain names
|
4
|
+
|
5
|
+
## 1.0.4
|
6
|
+
|
7
|
+
- Add option to populate seo cache for multi-domains
|
8
|
+
|
9
|
+
## 1.0.3
|
10
|
+
|
11
|
+
- Ensure page rendered status is present after head element
|
12
|
+
|
13
|
+
## 1.0.2
|
14
|
+
|
15
|
+
- Do not log missed cache for ignored statuses
|
16
|
+
|
17
|
+
## 1.0.1
|
18
|
+
|
19
|
+
- Add user agent to missed caches
|
20
|
+
|
1
21
|
## 1.0.0
|
2
22
|
|
3
23
|
- Update Readme (badges, syntax, links, ...)
|
data/README.md
CHANGED
@@ -227,6 +227,8 @@ end
|
|
227
227
|
|
228
228
|
You can add the `force_cache: true` option to `SeoCache::PopulateCache` for overwrite cached data.
|
229
229
|
|
230
|
+
If your website has several domains (.com, .fr, ...), you need to generate your urls for each locale (each key is the locale). And use the `with_locale_keys: true` option.
|
231
|
+
|
230
232
|
If you want to execute only through a rake task, you can comment the line which include the middleware. keep all options configured and remove only the middleware. Thus all pages will be cached and SeoCache isn't called for pages not in cache.
|
231
233
|
It's useful if you have a script which generates all website pages (based on sitemap for instance) and you run script every day.
|
232
234
|
|
@@ -275,6 +277,8 @@ location / {
|
|
275
277
|
rewrite ^/(.*)/$ /$1 last;
|
276
278
|
|
277
279
|
try_files /seo_cache/$uri/index$cache_extension /seo_cache/$uri$cache_extension /seo_cache/$uri $uri @rubyproxy;
|
280
|
+
# Or for multi-domains:
|
281
|
+
# try_files /seo_cache/fr/$uri/index$cache_extension /seo_cache/fr/$uri$cache_extension /seo_cache/fr/$uri $uri @rubyproxy;
|
278
282
|
}
|
279
283
|
|
280
284
|
location @rubyproxy {
|
data/lib/seo_cache/middleware.rb
CHANGED
@@ -21,7 +21,10 @@ module SeoCache
|
|
21
21
|
|
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)
|
26
|
+
SeoCache.log("missed cache : #{env_request.path} (User agent: #{env_request.user_agent})")
|
27
|
+
end
|
25
28
|
|
26
29
|
if SeoCache.prerender_service_url.present?
|
27
30
|
prerender_response = prerender_service(env)
|
@@ -33,8 +36,8 @@ module SeoCache
|
|
33
36
|
else
|
34
37
|
Thread.new do
|
35
38
|
prerender_data = page_render(env)
|
36
|
-
# Extract status from render page
|
37
|
-
status = prerender_data&.scan(/<!--status:(\d+)-->/)&.last&.first
|
39
|
+
# Extract status from render page or return 404
|
40
|
+
status = prerender_data&.scan(/<!--status:(\d+)-->/)&.last&.first
|
38
41
|
after_render(env, prerender_data, status || 200)
|
39
42
|
end
|
40
43
|
end
|
@@ -45,7 +48,7 @@ module SeoCache
|
|
45
48
|
status_code = "<!--status:#{status}-->"
|
46
49
|
# Cannot add at the top of file, Chrome removes leading comments...
|
47
50
|
begin
|
48
|
-
body_code = response.body.sub(
|
51
|
+
body_code = response.body.sub(/<head( ?)(.*?)>/i, "<head\\1\\2>#{status_code}")
|
49
52
|
return [status, headers, [body_code]]
|
50
53
|
rescue
|
51
54
|
return [status, headers, [nil]]
|
@@ -204,6 +207,11 @@ module SeoCache
|
|
204
207
|
def after_render(env, response, status = 200)
|
205
208
|
return unless response && SeoCache.cache_only_status.include?(status.to_i)
|
206
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
|
+
|
207
215
|
@page_caching.cache(response, Rack::Request.new(env).path)
|
208
216
|
end
|
209
217
|
end
|
@@ -17,12 +17,12 @@ module SeoCache
|
|
17
17
|
@redis.get(cache_path(path, extension)) if SeoCache.memory_cache? && @redis
|
18
18
|
end
|
19
19
|
|
20
|
-
def cache(content, path, extension = nil, gzip = Zlib::BEST_COMPRESSION)
|
20
|
+
def cache(content, path, locale_domain = nil, extension = nil, gzip = Zlib::BEST_COMPRESSION)
|
21
21
|
instrument :write_page, path do
|
22
22
|
if SeoCache.memory_cache? && @redis
|
23
|
-
write_to_memory(content, cache_path(path, extension))
|
23
|
+
write_to_memory(content, cache_path(path, extension, locale_domain))
|
24
24
|
else
|
25
|
-
write_to_disk(content, cache_path(path, extension), gzip)
|
25
|
+
write_to_disk(content, cache_path(path, extension, locale_domain), gzip)
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -51,22 +51,22 @@ module SeoCache
|
|
51
51
|
SeoCache.cache_extension
|
52
52
|
end
|
53
53
|
|
54
|
-
def cache_file(path, extension)
|
54
|
+
def cache_file(path, extension, locale_domain)
|
55
55
|
name = if path.empty? || path =~ %r{\A/+\z}
|
56
56
|
'/index'
|
57
57
|
else
|
58
58
|
URI::Parser.new.unescape(path.chomp('/'))
|
59
59
|
end
|
60
60
|
|
61
|
-
if
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
61
|
+
name = "#{locale_domain}/#{name}" if locale_domain
|
62
|
+
|
63
|
+
name += extension || default_extension if File.extname(name).empty?
|
64
|
+
|
65
|
+
name
|
66
66
|
end
|
67
67
|
|
68
|
-
def cache_path(path, extension = nil)
|
69
|
-
File.join(cache_directory, cache_file(path, extension))
|
68
|
+
def cache_path(path, extension = nil, locale_domain = nil)
|
69
|
+
File.join(cache_directory, cache_file(path, extension, locale_domain))
|
70
70
|
end
|
71
71
|
|
72
72
|
def write_to_memory(content, path)
|
@@ -11,27 +11,40 @@ module SeoCache
|
|
11
11
|
@page_render = PageRender.new
|
12
12
|
@page_caching = PageCaching.new
|
13
13
|
|
14
|
-
@force_cache
|
14
|
+
@force_cache = options.fetch(:force_cache, false)
|
15
|
+
@with_locale_keys = options.fetch(:with_locale_keys, false)
|
15
16
|
end
|
16
17
|
|
17
18
|
def perform
|
18
|
-
@
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
page_source = @page_render.get(url, false)
|
30
|
-
@page_caching.cache(page_source, path) if page_source
|
19
|
+
if @with_locale_keys
|
20
|
+
@paths.each do |locale, paths|
|
21
|
+
paths.each do |path|
|
22
|
+
generate_cache(path, locale)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
else
|
26
|
+
@paths.each do |path|
|
27
|
+
generate_cache(path)
|
28
|
+
end
|
31
29
|
end
|
32
30
|
|
33
31
|
ensure
|
34
32
|
@page_render.close_connection
|
35
33
|
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
def generate_cache(path, locale_domain = nil)
|
38
|
+
return if @page_caching.cache_exists?(path) && !@force_cache
|
39
|
+
|
40
|
+
url = @host + path
|
41
|
+
url += path.include?('?') ? '&' : '?'
|
42
|
+
url += "#{SeoCache.prerender_url_param}=true"
|
43
|
+
|
44
|
+
page_source = @page_render.get(url, false)
|
45
|
+
return unless page_source
|
46
|
+
|
47
|
+
@page_caching.cache(page_source, path, locale_domain)
|
48
|
+
end
|
36
49
|
end
|
37
50
|
end
|
data/lib/seo_cache/version.rb
CHANGED
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.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- FloXcoder
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -229,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
229
229
|
- !ruby/object:Gem::Version
|
230
230
|
version: '0'
|
231
231
|
requirements: []
|
232
|
-
rubygems_version: 3.
|
232
|
+
rubygems_version: 3.2.17
|
233
233
|
signing_key:
|
234
234
|
specification_version: 4
|
235
235
|
summary: Cache dedicated for SEO with Javascript rendering
|