diskcached 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -5
- data/lib/diskcached.rb +2 -2
- metadata +11 -52
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb0fc593b8bb16ed8498396063d554d711970db4
|
4
|
+
data.tar.gz: 539438e43b61262fd0de2d4da747dace7941505a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb0aa64796e91761d0910399030bc7d21000b337815ccd518010e719bbc9f20811f0802e72c37f410c91cbfaf99c2dc8b2516ec6b701d96a04e387f8bcc52794
|
7
|
+
data.tar.gz: 7e93f7f23d8dc211dfafea943e3015f536d1d23b538e0804c6fae30ad8b08a089050f095a91229bbd709a49266c0da841456de2384a7b2a94af5ef538f549f98
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
## Introduction
|
8
8
|
|
9
|
-
I created Diskcached as a simple cacheing layer for things like html fragments and database calls. I thought about using [memcached](http://memcached.org/), but as the app I was working on was running on a single server, it seemed overkill. Additionally, I looked at using [rack-cache](http://rtomayko.github.com/rack-cache/), but I felt it was a bit more complex then I was looking for. So Diskcached was born (although it was
|
9
|
+
I created Diskcached as a simple cacheing layer for things like html fragments and database calls. I thought about using [memcached](http://memcached.org/), but as the app I was working on was running on a single server, it seemed overkill. Additionally, I looked at using [rack-cache](http://rtomayko.github.com/rack-cache/), but I felt it was a bit more complex then I was looking for. So Diskcached was born (although it was originally released as "simple\_disk\_cache" -- for about 12 hours).
|
10
10
|
|
11
11
|
* To the comment: "I'm not clear how memcached on a single server is overkill."
|
12
12
|
> 1. In some cases -- e.g. Dreamhost shared hosting and Heroku (I believe) -- it is difficult, if not impossible to install memcached. This is for those situations.
|
@@ -40,7 +40,7 @@ Or with [Bundler](http://mervine.net/tag/bundler):
|
|
40
40
|
|
41
41
|
puts result
|
42
42
|
|
43
|
-
The above will create the cache if it doesn't exist and cache the result of block and return it. If the cache exists and isn't expired, it will read from the cache and
|
43
|
+
The above will create the cache if it doesn't exist and cache the result of block and return it. If the cache exists and isn't expired, it will read from the cache and return what's stored. This allows you to passively wrap code in a cache block and not worry about checking to see if it's valid or expired.
|
44
44
|
|
45
45
|
Also worth noting, it will return `nil` if something goes wrong.
|
46
46
|
|
@@ -61,14 +61,14 @@ Using Diskcached like this should allow for a "drag and drop" replacement of Mem
|
|
61
61
|
|
62
62
|
puts result
|
63
63
|
|
64
|
-
It's important to note that Diskcached is quite a bit simpler then Memcached and in some ways more forgiving. If Memcached
|
64
|
+
It's important to note that Diskcached is quite a bit simpler then Memcached and in some ways more forgiving. If Memcached compatibility is really important, refer to Memcached docs as well as Diskcached docs when implementing your code.
|
65
65
|
|
66
66
|
## Benchmarks
|
67
67
|
|
68
68
|
### Comments
|
69
69
|
|
70
70
|
Diskcached wasn't designed to be a faster solution, just a simpler
|
71
|
-
one when
|
71
|
+
one when compared to Memcached. However, from these benchmarks,
|
72
72
|
it holds up will and even should provide slightly faster reads.
|
73
73
|
|
74
74
|
##### [Moved to 'Benchmark Output'](https://github.com/jmervine/diskcached/wiki/Benchmark-Output)
|
@@ -134,4 +134,3 @@ Using the endpoint [http://mervine.net/](http://mervine.net/) on my dev server a
|
|
134
134
|
|
135
135
|
Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0
|
136
136
|
Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0
|
137
|
-
|
data/lib/diskcached.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# @author Joshua P. Mervine <joshua@mervine.net>
|
2
2
|
class Diskcached
|
3
3
|
# version for gem
|
4
|
-
VERSION = '1.1.
|
4
|
+
VERSION = '1.1.3'
|
5
5
|
|
6
6
|
# disk location for cache store
|
7
7
|
attr_reader :store
|
@@ -21,7 +21,7 @@ class Diskcached
|
|
21
21
|
# initialize object
|
22
22
|
# - set #store to passed or default ('/tmp/cache')
|
23
23
|
# - set #timeout to passed or default ('600')
|
24
|
-
# - set #
|
24
|
+
# - set #autogc to passed or default ('false')
|
25
25
|
# - run #ensure_store_directory
|
26
26
|
def initialize store="/tmp/cache", timeout=600, autogc=true
|
27
27
|
@store = store
|
metadata
CHANGED
@@ -1,57 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: diskcached
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua Mervine
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: rspec
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - '>='
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - '>='
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: simplecov
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - '>='
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - '>='
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rdoc
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - '>='
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - '>='
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
11
|
+
date: 2017-02-20 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
55
13
|
description: Simple disk cache for things like Sinatra which is implemented much like
|
56
14
|
Memcached in hopes that in some cases they're interchangeable.
|
57
15
|
email:
|
@@ -60,14 +18,15 @@ executables: []
|
|
60
18
|
extensions: []
|
61
19
|
extra_rdoc_files: []
|
62
20
|
files:
|
63
|
-
- lib/diskcached.rb
|
64
|
-
- README.md
|
65
|
-
- HISTORY.md
|
66
21
|
- Benchmark.md
|
67
22
|
- Gemfile
|
23
|
+
- HISTORY.md
|
24
|
+
- README.md
|
68
25
|
- Rakefile
|
26
|
+
- lib/diskcached.rb
|
69
27
|
homepage: http://diskcached.rubyops.net/
|
70
|
-
licenses:
|
28
|
+
licenses:
|
29
|
+
- MIT
|
71
30
|
metadata: {}
|
72
31
|
post_install_message:
|
73
32
|
rdoc_options: []
|
@@ -75,17 +34,17 @@ require_paths:
|
|
75
34
|
- lib
|
76
35
|
required_ruby_version: !ruby/object:Gem::Requirement
|
77
36
|
requirements:
|
78
|
-
- -
|
37
|
+
- - ">="
|
79
38
|
- !ruby/object:Gem::Version
|
80
39
|
version: '0'
|
81
40
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
41
|
requirements:
|
83
|
-
- -
|
42
|
+
- - ">="
|
84
43
|
- !ruby/object:Gem::Version
|
85
44
|
version: 1.3.6
|
86
45
|
requirements: []
|
87
46
|
rubyforge_project:
|
88
|
-
rubygems_version: 2.
|
47
|
+
rubygems_version: 2.5.1
|
89
48
|
signing_key:
|
90
49
|
specification_version: 4
|
91
50
|
summary: Simple disk cache
|