Skip to content

tigris/open-uri-cached

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenURI with caching

Carelessly make OpenURI requests without getting hate mail.

Usage

Require the library

require 'open-uri/cached'
open('http://www.someone-that-hates-being-scraped.com').read

Configuring

OpenURI::Cache.cache_path = '/tmp/open-uri'

Invalidating

OpenURI::Cache.invalidate('https://example.com/')

OpenURI::Cache.invalidate_all!