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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ballonizer_proxy.rb +18 -0
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cc82bed38b6e7913962f2e4488c5eb3d2b0ee5e6
4
- data.tar.gz: d77c92f0d7d9645eb68b88e8e9063d445af058b5
3
+ metadata.gz: 9388f9f0e99712d7d92479fb55f6267d804eeaa2
4
+ data.tar.gz: a88a56c2705a4a350cbab015bcecfa467afdd4bd
5
5
  SHA512:
6
- metadata.gz: 34358143e524b552c95a2dc49d8953d348789db429f38871702d5cd3d684f0afdbf89e8518bb5df33a5fc0143840d470d76b3e9db347f68f0cf347abdccb342a
7
- data.tar.gz: d4989cf1794df71f2e50a86000c27dd44bb59b73c36c4578d30392fdaadba9fe261d3c52a983516d3a700261d13d807f7e727603f5c60b1b127732d434d9332e
6
+ metadata.gz: a07a9cc0c92a5f08d00bf2bed27933c700984809fcd3c4f6baef293fb7659295b33abc6ee35aabe63d9aa683ef9bd25def1f678946e21a84922758e6d62d2bf8
7
+ data.tar.gz: 7fdab2e86e670a2cd795bd4a0e38679df2b6a244bbda08c528c978eb12a7d82cc77ad26b9b9956ed2610183a43d65bf6415877c2d74570b78e9aee5813756e1a
@@ -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.3
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-22 00:00:00.000000000 Z
11
+ date: 2013-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ballonizer