acorn_cache 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cd4a59e38e279614a289b1a8e1e6c235389f615b
4
- data.tar.gz: 1558ff76e457e53fc6530c180cd5381ec050cbb9
3
+ metadata.gz: 7a2d9940673a713c2d067e7156a4e8ce121c3cc6
4
+ data.tar.gz: efdf2438b730d2452d80efa880edb09ff224f30a
5
5
  SHA512:
6
- metadata.gz: 3014f53f2ec919dcbcae36b7c81c0ce7c686bf71499b681c6fd29d9ba76cc85ee63afce3bbff3fb8d1517964c269b959d090746cd2ce7d78f50b34e9cd317d46
7
- data.tar.gz: 52bda2e31c8780828b486f6b22aebcf740d26a17a6f019e6daf9877fab93365e4115659e088cfc47429f3898528c935501ba4c24ad0ce9cc08b3edf1f4678067
6
+ metadata.gz: 1ac818acc82582947bf09afbf3daa3ec2e9a2641de379538fa3c6fbd090f28d49290474e4bb8ae755ec69a605d6998ba1eb4191f315d71ea45030ca9bec5c1d0
7
+ data.tar.gz: 498cab5ea208d38db6302b82078dacc9889b1c58872e3ae74aebd7b8fac333b991a2ac72536bb6f6e37f310706edbed4d7c4168f3edd6c81d5b8684180be54cf
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # AcornCache
1
+ ![AcornCache](http://i.imgur.com/6zdrz8A.png?1)
2
2
 
3
3
  AcornCache is a Ruby HTTP proxy caching library that is lightweight, configurable and can be easily integrated with any Rack-based web application. AcornCache allows you to improve page load times and lighten the load on your server by allowing you to implement an in-memory cache shared by every client requesting a resource on your server.
4
4
 
@@ -185,6 +185,7 @@ RackAcornCache.configure do |config|
185
185
  config.page_rules = {
186
186
  "http://foo.com" => { use_defaults: true }
187
187
  "http://bar.com" => { acorn_cache_ttl: 100 }
188
+ }
188
189
  end
189
190
  ```
190
191
 
@@ -64,7 +64,7 @@ class Rack::AcornCache
64
64
  end
65
65
 
66
66
  def time_to_live
67
- s_maxage || max_age || (expiration_header_time - date)
67
+ s_maxage || max_age || (expiration_date - date)
68
68
  end
69
69
 
70
70
  alias_method :stale_time_specified?, :time_to_live
@@ -31,7 +31,7 @@ class Rack::AcornCache
31
31
  end
32
32
 
33
33
  def page_rule
34
- config.page_rule_for_url(url) if config
34
+ @page_rule ||= config.page_rule_for_url(url) if config
35
35
  end
36
36
 
37
37
  def cache_key
@@ -26,6 +26,10 @@ class Rack::AcornCache
26
26
  status == 304
27
27
  end
28
28
 
29
+ def etag_header
30
+ headers["ETag"]
31
+ end
32
+
29
33
  def serialize
30
34
  { status: status, headers: headers, body: body_string }.to_json
31
35
  end
@@ -1,3 +1,3 @@
1
1
  module AcornCache
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acorn_cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vincent J. DeVendra
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-03-02 00:00:00.000000000 Z
12
+ date: 2016-03-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler