seo_cache 0.9.0 → 0.10.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 +34 -20
- data/lib/seo_cache/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ff4b04ea72963e8609ce8ebc7ddd53e4c2f05087f80f13363f4810bc2a0f46f
|
4
|
+
data.tar.gz: 8072db1df79a2a2a530815fe6054fd40f3abbd162b782de2304f6af7ada944d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64088bbe57c6e6859ba0c0b578112b52bfeffd6b2f64f9cef2f88a63c946bfb27183f94245fe4ed8bba37731fde0cebc19a783972cb92ac0692927b8d6bc7a23
|
7
|
+
data.tar.gz: 1ac9cbe9ee21dbeee0a675f88799c48bdc23b85b6296d9e971b954204ad03aac5116b653095ec0a70481e1f579be138e8bb659f37d12fdc3c710978f3887ae62
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -186,6 +186,33 @@ You can add the `force_cache: true` option to `SeoCache::PopulateCache` for over
|
|
186
186
|
If you use disk caching, add to your Nginx configuration:
|
187
187
|
|
188
188
|
```nginx
|
189
|
+
# Before any block:
|
190
|
+
map $http_user_agent $limit_bots {
|
191
|
+
default 0;
|
192
|
+
~*(google|bing|yandex|msnbot) 1;
|
193
|
+
}
|
194
|
+
|
195
|
+
map $request_method $is_get {
|
196
|
+
default 0;
|
197
|
+
GET 1;
|
198
|
+
}
|
199
|
+
|
200
|
+
# Before location block:
|
201
|
+
set $bot_request '';
|
202
|
+
if ($is_get) {
|
203
|
+
set $bot_request 'GET_';
|
204
|
+
}
|
205
|
+
|
206
|
+
if ($limit_bots) {
|
207
|
+
set $bot_request "${bot_request}BOT";
|
208
|
+
}
|
209
|
+
|
210
|
+
set $cache_extension '';
|
211
|
+
if ($bot_request = GET_BOT) {
|
212
|
+
set $cache_extension '.html';
|
213
|
+
}
|
214
|
+
|
215
|
+
# Inside location block:
|
189
216
|
location / {
|
190
217
|
# Ignore url with blacklisted params (e.g. page)
|
191
218
|
if ($arg_page) {
|
@@ -195,29 +222,16 @@ location / {
|
|
195
222
|
break;
|
196
223
|
}
|
197
224
|
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
# Index HTML Files
|
205
|
-
if (-f $document_root/seo_cache/$uri/index$cache_extension) {
|
206
|
-
rewrite (.*) /seo_cache/$1/index.html break;
|
207
|
-
}
|
208
|
-
|
209
|
-
# Other HTML Files
|
210
|
-
if (-f $document_root/seo_cache/$uri$cache_extension) {
|
211
|
-
rewrite (.*) /seo_cache/$1.html break;
|
212
|
-
}
|
213
|
-
|
214
|
-
# All
|
215
|
-
if (-f $document_root/seo_cache/$uri) {
|
216
|
-
rewrite (.*) /seo_cache/$1 break;
|
217
|
-
}
|
225
|
+
try_files /seo_cache/$uri/index$cache_extension /seo_cache/$uri$cache_extension /seo_cache/$uri $uri @rubyproxy;
|
226
|
+
}
|
227
|
+
|
228
|
+
location @rubyproxy {
|
229
|
+
...
|
218
230
|
}
|
219
231
|
```
|
220
232
|
|
233
|
+
This configuration allow you to use SEO cache only for bots (you can add other bots) and GET requests. For users, you don't want to use the cached page (user connection, basket, ...). The performance are less important for users then bots.
|
234
|
+
|
221
235
|
## Heroku case
|
222
236
|
|
223
237
|
If you use Heroku server, you can't store file on dynos. But you have two alternatives :
|
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: 0.
|
4
|
+
version: 0.10.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-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|