On Tue, May 31, 2011 at 8:25 PM, craayzie <flesh...@gmail.com> wrote:

> I'm setting a 'Cache-Control: public, max-age=300' response header per
> the Heroku docs but when I request the resource, Heroku logs show my
> app processing the request and subsequent requests for the same
> resource continue to hit my app.
>
> Any guidance on how to troubleshoot this further to figure out why
> Varnish isn't caching?
>

What stack and how many dynos is this app running? On Bamboo the setup is
something like 1 varnish instance per dyno. If you have 5 dynos, it's going
to hit your app at most 5 times before it's fully cached. I noticed the same
behavior and Heroku support set me straight.

If it's important that a request only hit your app once, take a look at
rack-cache <http://rtomayko.github.com/rack-cache/> paired with the memcache
add-on <http://devcenter.heroku.com/articles/memcache>. Jim Gay wrote a
great post detailing his
setup<http://www.saturnflyer.com/blog/jim/2010/06/24/rack-cache-on-heroku-with-memcached/>.
This
is the recommended approach on Cedar because it doesn't come with a reverse
proxy cache.
-- 
Larry Marburger
Homeopathic Code Remedyologist

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to heroku@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.

Reply via email to