This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
.gitignore | ||
| |
History.txt | ||
| |
License.txt | ||
| |
README.markdown | ||
| |
lib/ | ||
| |
open-uri-memcached.gemspec | ||
| |
pkg/ | Thu Apr 17 00:10:20 -0700 2008 | |
| |
spec/ |
README.markdown
OpenURI with caching
Carelessly make OpenURI requests without getting hate mail.
Running with MemCached
Require the library
require 'openuri/memcached'
Start memcached server
ben@Spinners ~/ Ϟ memcached -d
Set your memcached host/s (defaults to 127.0.0.1:11211)
OpenURI::Cache.host = ['10.1.1.10:11211', '10.1.1.11:11211']
The default expiry is 15 minutes, this can be changed using the expiry method
# Ten long minutes
OpenURI::Cache.expiry = 600
Running using Rails cache
You can also cache your OpenURI calls using Rails cache.
require the library using require openuri/rails-cache
Execution
Use exactly the same as you would OpenURI, only.. enable it.
OpenURI::Cache.enable!
# As slow a wet week
open("http://ab-c.com.au").read
Quit your app (leave memcached running) and re-run the same request, It will come from cache.
Requirements
- Ruby
- MemCached
- memcache (gem)
- You will need to ensure that you have corresponding version of libmemcached to the memcached gem installed for installation to go by breezy








