startback 2.1.2 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +29 -0
- data/lib/startback/version.rb +1 -1
- data/lib/startback/web/auto_caching.rb +6 -2
- data/spec/unit/web/test_auto_caching.rb +2 -2
- 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: 6faa6fe4856146f74795957a004c60e81db8a19a70ce6bcb874f9490c9012f99
|
|
4
|
+
data.tar.gz: 94debf9522beae906f8a725f9549d9acaebecbf6702969c1ea7ab73c6d0df926
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1e0e25409e12e35623aba0fc4dbdeaa9cdeef0cbe4f78b0a29b98c47445100776708b58e13ac28251d5a36b13cb9cb9323b6dcacda18df51c237eed903fe9766
|
|
7
|
+
data.tar.gz: b290c7942c9a985da8aa40904547b73dc7e6388bdb21c65a95bfb4d6ffd135577457f3914c61300c4a55d4dbf3052900d38be04862e18005a1461a1578264462
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
## 2.1.3 - 2026-10-29
|
|
2
|
+
|
|
3
|
+
A one-character fix to AutoCaching's production policy. **Nothing to do, and
|
|
4
|
+
nothing changes for an application that kept the default** -- but the knob it
|
|
5
|
+
unlocks is worth knowing about.
|
|
6
|
+
|
|
7
|
+
### `s-maxage`, not `s-max-age`
|
|
8
|
+
|
|
9
|
+
The default production policy read `public, must-revalidate, max-age=3600,
|
|
10
|
+
s-max-age=3600`. There is no `s-max-age` directive: caches skip what they do
|
|
11
|
+
not recognise, so a shared cache had nothing but `max-age` to go by. Same
|
|
12
|
+
hour either way, which is why this went unnoticed -- the two values were
|
|
13
|
+
equal.
|
|
14
|
+
|
|
15
|
+
It matters the moment they should not be. A page whose reverse proxy should
|
|
16
|
+
hold it for an hour while the browser comes back in a minute is exactly what
|
|
17
|
+
`s-maxage` is for, and overriding the policy to say so had no effect on the
|
|
18
|
+
proxy:
|
|
19
|
+
|
|
20
|
+
```ruby
|
|
21
|
+
# Now does what it says: one minute in the browser, one hour in nginx.
|
|
22
|
+
use Startback::Web::AutoCaching, production: "public, max-age=60, s-maxage=3600"
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Worth a look if your application already overrides
|
|
26
|
+
`PRODUCTION_CACHE_CONTROL`, or sets
|
|
27
|
+
`STARTBACK_AUTOCACHING_PRODUCTION_CACHE_CONTROL`, with a `s-max-age` copied
|
|
28
|
+
from the default: it was being ignored, and now it is not.
|
|
29
|
+
|
|
1
30
|
## 2.1.2 - 2026-10-27
|
|
2
31
|
|
|
3
32
|
A crawler could take a page down for everyone. **AutoCaching's fix needs
|
data/lib/startback/version.rb
CHANGED
|
@@ -51,9 +51,13 @@ module Startback
|
|
|
51
51
|
DEVELOPMENT_CACHE_CONTROL = ENV['STARTBACK_AUTOCACHING_DEVELOPMENT_CACHE_CONTROL'] || \
|
|
52
52
|
"no-cache, no-store, max-age=0, must-revalidate"
|
|
53
53
|
|
|
54
|
-
# Cache-Control header to use in production mode
|
|
54
|
+
# Cache-Control header to use in production mode. `s-maxage`, and not
|
|
55
|
+
# `s-max-age`: the latter is not a directive any cache knows, so it was
|
|
56
|
+
# silently dropped and a shared cache had nothing but `max-age` to go by
|
|
57
|
+
# -- the very knob an application needs to keep a page in its reverse
|
|
58
|
+
# proxy for an hour while the browser comes back in a minute.
|
|
55
59
|
PRODUCTION_CACHE_CONTROL = ENV['STARTBACK_AUTOCACHING_PRODUCTION_CACHE_CONTROL'] ||\
|
|
56
|
-
"public, must-revalidate, max-age=3600, s-
|
|
60
|
+
"public, must-revalidate, max-age=3600, s-maxage=3600"
|
|
57
61
|
|
|
58
62
|
# Cache-Control header to use on an error response, in either mode
|
|
59
63
|
ERROR_CACHE_CONTROL = ENV['STARTBACK_AUTOCACHING_ERROR_CACHE_CONTROL'] ||\
|
|
@@ -30,7 +30,7 @@ module Startback
|
|
|
30
30
|
|
|
31
31
|
it 'sets the production Cache-Control' do
|
|
32
32
|
get '/'
|
|
33
|
-
expect(last_response['Cache-Control']). to eql("public, must-revalidate, max-age=3600, s-
|
|
33
|
+
expect(last_response['Cache-Control']). to eql("public, must-revalidate, max-age=3600, s-maxage=3600")
|
|
34
34
|
end
|
|
35
35
|
end
|
|
36
36
|
|
|
@@ -88,7 +88,7 @@ module Startback
|
|
|
88
88
|
end
|
|
89
89
|
|
|
90
90
|
it 'still makes a redirect cacheable' do
|
|
91
|
-
expect(cache_control_for(301)).to eql("public, must-revalidate, max-age=3600, s-
|
|
91
|
+
expect(cache_control_for(301)).to eql("public, must-revalidate, max-age=3600, s-maxage=3600")
|
|
92
92
|
end
|
|
93
93
|
end
|
|
94
94
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: startback
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.1.
|
|
4
|
+
version: 2.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bernard Lambeau
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rspec
|