Displaying 1 result from an estimated 1 matches for "find_by_uri".
Did you mean:
find_by_url
2012 Jul 23
2
Mechanize::Agent#post_connect_hook response != Mechanize#parse response
...da {|agent, uri, response, body|
CachedWebPage.create!(:uri => uri.to_s,
:response => response
:contents => body)
}
end
def get(uri, parameters = [], referer = nil, headers = {})
page = if (cached = CachedWebPage.find_by_uri(uri.to_s))
# cache hit
parse(cached.uri, cached.response, cached.contents)
else
# cache miss -- post_connect_hook will write to cache
super
end
yield page if block_given?
page
end
end
It turns out that Mechanize#p...