ballonizer_proxy 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ballonizer_proxy.rb +18 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9388f9f0e99712d7d92479fb55f6267d804eeaa2
|
4
|
+
data.tar.gz: a88a56c2705a4a350cbab015bcecfa467afdd4bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a07a9cc0c92a5f08d00bf2bed27933c700984809fcd3c4f6baef293fb7659295b33abc6ee35aabe63d9aa683ef9bd25def1f678946e21a84922758e6d62d2bf8
|
7
|
+
data.tar.gz: 7fdab2e86e670a2cd795bd4a0e38679df2b6a244bbda08c528c978eb12a7d82cc77ad26b9b9956ed2610183a43d65bf6415877c2d74570b78e9aee5813756e1a
|
data/lib/ballonizer_proxy.rb
CHANGED
@@ -43,8 +43,26 @@ class BallonizerProxy < PrettyProxy
|
|
43
43
|
page, original_url, headers['content-type'], absolute_settings
|
44
44
|
)
|
45
45
|
|
46
|
+
# This makes the browser always request a new copy of the document (status
|
47
|
+
# 200) and avoid 304 status without body to us ballonize (and the ballons
|
48
|
+
# can be updated without the original page being updated so isn't
|
49
|
+
# interesting to preserve the original cache control)
|
50
|
+
Workarounds.make_uncacheable(headers)
|
51
|
+
|
46
52
|
triplet = [status, headers, page]
|
47
53
|
end
|
54
|
+
|
55
|
+
module Workarounds
|
56
|
+
# NOTE: THIS CHANGES THE ARGUMENT
|
57
|
+
def self.make_uncacheable(headers)
|
58
|
+
headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate"
|
59
|
+
headers["Pragma"] = "no-cache"
|
60
|
+
headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
|
61
|
+
headers
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
private_constant :Workarounds
|
48
66
|
end
|
49
67
|
|
50
68
|
# A class to automate the creation of an rack app that offer multiple
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ballonizer_proxy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henrique Becker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ballonizer
|