seo_cache 0.18.0 → 0.19.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 +4 -0
- data/README.md +9 -0
- data/lib/seo_cache/middleware.rb +3 -0
- data/lib/seo_cache/populate_cache.rb +4 -3
- data/lib/seo_cache/version.rb +1 -1
- data/lib/seo_cache.rb +3 -0
- 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: 93939e53687c186d003b4b09abed06bcf1b6ac0a63b808c3a7abfadd7e6531cb
|
4
|
+
data.tar.gz: 4d362ee26521e0ebb55b61c15e6b9d5e6c9e19877e57ead9cfab9765c4310142
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc485c1ea013d77fcf9337c3423bacec563701b319d79b4949304f6bf51fe78c54a3553cdf875b8067e60c1c9c8ae3667dfeec0ee8f29f3991079d5662c3ffa7
|
7
|
+
data.tar.gz: 1d634743d69e52965d9c450b046dc19edabd88b92783c567c460a11b7407473d395600775cd5aaff31f96db5b68fa5143954f90fa7b154fbccf76f3f9284e00b
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -112,6 +112,12 @@ URLs to whitelist:
|
|
112
112
|
SeoCache.whitelist_urls = []
|
113
113
|
```
|
114
114
|
|
115
|
+
Cache page even if user is connected (be careful when caching sensitive data):
|
116
|
+
|
117
|
+
```ruby
|
118
|
+
SeoCache.cache_with_user_connected = true
|
119
|
+
```
|
120
|
+
|
115
121
|
Parameter to add manually to the URl to force page caching, if you want to cache a specific URL (e.g. `https://<my_website>/?_seo_cache_=true`):
|
116
122
|
|
117
123
|
```ruby
|
@@ -236,6 +242,9 @@ location / {
|
|
236
242
|
if ($arg__seo_cache_) {
|
237
243
|
break;
|
238
244
|
}
|
245
|
+
|
246
|
+
# Local rewrite to remove trailing slash
|
247
|
+
rewrite ^/(.*)/$ /$1 last;
|
239
248
|
|
240
249
|
try_files /seo_cache/$uri/index$cache_extension /seo_cache/$uri$cache_extension /seo_cache/$uri $uri @rubyproxy;
|
241
250
|
}
|
data/lib/seo_cache/middleware.rb
CHANGED
@@ -78,6 +78,9 @@ module SeoCache
|
|
78
78
|
request = Rack::Request.new(env)
|
79
79
|
query_params = Rack::Utils.parse_query(request.query_string)
|
80
80
|
|
81
|
+
# Check if user connected
|
82
|
+
return false if !SeoCache.cache_with_user_connected && (env['warden'].respond_to?(:user) && env['warden'].user.present?)
|
83
|
+
|
81
84
|
# If it is the generated page...don't prerender
|
82
85
|
return false if query_params.has_key?(SeoCache.prerender_url_param)
|
83
86
|
|
@@ -6,9 +6,9 @@ require 'seo_cache/page_render'
|
|
6
6
|
module SeoCache
|
7
7
|
class PopulateCache
|
8
8
|
def initialize(host, paths, options = {})
|
9
|
-
@host
|
10
|
-
@paths
|
11
|
-
@page_render
|
9
|
+
@host = host
|
10
|
+
@paths = paths
|
11
|
+
@page_render = PageRender.new
|
12
12
|
@page_caching = PageCaching.new
|
13
13
|
|
14
14
|
@force_cache = options.fetch(:force_cache, false)
|
@@ -30,6 +30,7 @@ module SeoCache
|
|
30
30
|
@page_caching.cache(page_source, path)
|
31
31
|
end
|
32
32
|
|
33
|
+
ensure
|
33
34
|
@page_render.close_connection
|
34
35
|
end
|
35
36
|
end
|
data/lib/seo_cache/version.rb
CHANGED
data/lib/seo_cache.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: 0.
|
4
|
+
version: 0.19.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- FloXcoder
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -226,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
226
226
|
- !ruby/object:Gem::Version
|
227
227
|
version: '0'
|
228
228
|
requirements: []
|
229
|
-
rubygems_version: 3.1.
|
229
|
+
rubygems_version: 3.1.3
|
230
230
|
signing_key:
|
231
231
|
specification_version: 4
|
232
232
|
summary: Cache dedicated for SEO with Javascript rendering
|