I am trying to cache a response from a server locally per example shown here.
#!/usr/bin/env ruby
require 'restclient/components'
require 'rack/cache'
RestClient.enable Rack::Cache,
:metastore => 'file:/tmp/cache/meta',
:entitystore => 'file:/tmp/cache/body',
:verbose => true
RestClient.get 'http://www.google.com/intl/en/policies/privacy/?fg=1'
Somehow I always get miss as a response and the folder is empty. I guess caching doesn't work for me. What am I doing wrong?
cache: [GET /intl/en/policies/privacy/?fg=1] miss
Update
The repsponse header contains:
Cache-Control: must-revalidate, private, max-age=0
So I guess my question is how to intercept a response before it is processed and modify response header fields?