seo_cache 1.2.2 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +7 -1
- data/lib/seo_cache/page_caching.rb +1 -1
- data/lib/seo_cache/page_render.rb +7 -3
- data/lib/seo_cache/version.rb +1 -1
- data/lib/seo_cache.rb +4 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e86d1a27899b2f4dda73d5f014720623580897e82088dfd173f2e023062e6b5
|
4
|
+
data.tar.gz: d469331650905b95e0d8323691e187bdb379c14591c8ebc7c8cf5e86e879fa4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc8ec629eb1dc796049e597c1f1f66ca7432596da2e9e49a3c85804488612c59a963a8400ed4a468b5127e1488e50b772b5b04426e66fc59739d877a2cdad9c9
|
7
|
+
data.tar.gz: cc887ac4e411613c745290442ffe8320fefc145b8a0b300fdaca26ae12a59ac4d7c107f17fc8114b0aa6016605ed033dc6657a3e1febfb0308fd8cc13ef6d936
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -86,12 +86,18 @@ Redis URL (**required** if memory cache):
|
|
86
86
|
SeoCache.redis_url = "redis://localhost:6379/"
|
87
87
|
```
|
88
88
|
|
89
|
-
Redis prefix:
|
89
|
+
Redis prefix (if needed):
|
90
90
|
|
91
91
|
```ruby
|
92
92
|
SeoCache.redis_namespace = '_my_project:seo_cache'
|
93
93
|
```
|
94
94
|
|
95
|
+
Redis database index (if needed):
|
96
|
+
|
97
|
+
```ruby
|
98
|
+
SeoCache.redis_db_index = 1
|
99
|
+
```
|
100
|
+
|
95
101
|
Waiting time before the page is fully loaded (optional in sec, useful for async elements):
|
96
102
|
|
97
103
|
```ruby
|
@@ -10,7 +10,7 @@ module SeoCache
|
|
10
10
|
|
11
11
|
def initialize_memory_cache
|
12
12
|
uri = URI.parse(SeoCache.redis_url)
|
13
|
-
@redis = Redis::Namespace.new(SeoCache.redis_namespace, redis: Redis.new(host: uri.host, port: uri.port, password: uri.password, connect_timeout: 1, timeout: 1), warnings: false)
|
13
|
+
@redis = Redis::Namespace.new(SeoCache.redis_namespace, redis: Redis.new(host: uri.host, port: uri.port, password: uri.password, db: SeoCache.redis_db_index, connect_timeout: 1, timeout: 1), warnings: false)
|
14
14
|
end
|
15
15
|
|
16
16
|
def get(path, locale_domain = nil, extension = nil)
|
@@ -27,7 +27,10 @@ module SeoCache
|
|
27
27
|
private
|
28
28
|
|
29
29
|
def init_driver
|
30
|
-
|
30
|
+
if SeoCache.logger_path
|
31
|
+
Selenium::WebDriver.logger.output = SeoCache.logger_path
|
32
|
+
Selenium::WebDriver.logger.level = SeoCache.logger_level
|
33
|
+
end
|
31
34
|
|
32
35
|
Webdrivers.cache_time = 86_400 * 10 # Chromedriver will be cached for 10 days (except if it detects a new version of Chrome)
|
33
36
|
|
@@ -35,11 +38,12 @@ module SeoCache
|
|
35
38
|
|
36
39
|
browser_options = %w[headless incognito disable-gpu disable-infobars disable-dev-shm-usage disable-gpu disable-web-security disable-extensions no-sandbox disable-logging disable-notifications disable-sync window-size=1920x1080]
|
37
40
|
browser_options << "remote-debugging-port=#{SeoCache.chrome_debugging_port}" if SeoCache.chrome_debugging_port
|
41
|
+
|
38
42
|
@driver = ::Selenium::WebDriver.for(
|
39
43
|
:chrome,
|
40
|
-
|
44
|
+
options: Selenium::WebDriver::Chrome::Options.new(
|
41
45
|
args: browser_options
|
42
|
-
)
|
46
|
+
)
|
43
47
|
)
|
44
48
|
end
|
45
49
|
end
|
data/lib/seo_cache/version.rb
CHANGED
data/lib/seo_cache.rb
CHANGED
@@ -34,6 +34,9 @@ module SeoCache
|
|
34
34
|
mattr_accessor :redis_url
|
35
35
|
self.redis_url = 'redis://localhost:6379/'
|
36
36
|
|
37
|
+
mattr_accessor :redis_db_index
|
38
|
+
self.redis_db_index = 0
|
39
|
+
|
37
40
|
mattr_accessor :redis_namespace
|
38
41
|
self.redis_namespace = '_seo_cache:'
|
39
42
|
|
@@ -120,7 +123,7 @@ module SeoCache
|
|
120
123
|
self.logger_path = nil
|
121
124
|
|
122
125
|
mattr_accessor :logger_level
|
123
|
-
self.logger_level = :
|
126
|
+
self.logger_level = :warn
|
124
127
|
|
125
128
|
mattr_accessor :logger
|
126
129
|
# self.logger = SeoCache::Logger.new(SeoCache.logger_path)
|
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.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- FloXcoder
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -214,7 +214,7 @@ homepage: https://github.com/floXcoder/seo_cache
|
|
214
214
|
licenses:
|
215
215
|
- MIT
|
216
216
|
metadata: {}
|
217
|
-
post_install_message:
|
217
|
+
post_install_message:
|
218
218
|
rdoc_options: []
|
219
219
|
require_paths:
|
220
220
|
- lib
|
@@ -229,8 +229,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
229
229
|
- !ruby/object:Gem::Version
|
230
230
|
version: '0'
|
231
231
|
requirements: []
|
232
|
-
rubygems_version: 3.
|
233
|
-
signing_key:
|
232
|
+
rubygems_version: 3.4.7
|
233
|
+
signing_key:
|
234
234
|
specification_version: 4
|
235
235
|
summary: Cache dedicated for SEO with Javascript rendering
|
236
236
|
test_files: []
|