taking a look at that page using redbot.org

http://redbot.org/?uri=http%3A%2F%2Fhigh-night-436.heroku.com%2Fthingies%2F1

<http://redbot.org/?uri=http%3A%2F%2Fhigh-night-436.heroku.com%2Fthingies%2F1>I
see that the cache is set to private, so varnish can't cache it and the max
age and age are both 0, so the browser thinks its stale, and has to
revalidate it.

For more info on this, check out the super-awesome 'Scaling
Rails<http://railslab.newrelic.com/2009/02/25/episode-10-client-side-caching>'
series by Gregg Pollack and New Relic.

Leveraging client side caching, and varnish is the best strategy to get the
single free dyno to take you as far as possible. (heroku is great in that
they encourage your 'inner cheapskate' because you really can run a full
site on a single dyno pretty well if you tune things well)



On Wed, Mar 23, 2011 at 5:28 AM, Toproper <[email protected]> wrote:

> I'm trying to learn more about caching strategies and I'm trying to
> wrap my head around conditional GET in Rails. I think I get the basic
> idea but I can't get it to work properly, or maybe I'm understanding
> it wrong. Either way, some help would be appreciated.
>
> I have made a simple test app with the following action:
>
> def show
>  @thing = Thing.find(params[:id])
>  fresh_when(:etag => @thing, :last_modified => @thing.updated_at.utc)
> end
>
> The url of this representation is:
> http://high-night-436.heroku.com/thingies/1
>
> As I understand it this url should return a 304 not modified header
> after the first visit, but it doesn't. My first thought was that maybe
> I'm understanding this wrong and Varnish receives this header and
> servers the cached page, but I don't think this is happening either.
> To test this I included some code in the view that shows a random item
> from an array, if the page was server from the cache this item should
> always be the same.
>
> I think I'm misunderstanding some basic concepts here, but I can't
> figure out what those are exactly.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Heroku" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/heroku?hl=en.
>
>


-- 
-John

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

Reply via email to