I've found logging into the heroku console and then clearing the cache to be
quite effective:
[ D:\Users\charlesr\Documents\My Dropbox\Projects\radiant_roast ]
> heroku console
Ruby console for foobarbaz.heroku.com
>> Radiant::Cache.clear
=> [#<Radiant::Cache::EntityStore:0x2b5c98de4a20
@root="/disk1/home/slugs/89730_0ada040_1fcc/mnt/tmp/cache/entity">]
>>
Is this the best way of tackling a cache refresh, or should I be doing
something else?
Cheers,
Charles
_______________________________________________
Radiant mailing list
Post: Rad...@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Sean
> That seems correct. I'm not sure about their other infrastructure, but
> as of the current version, doing a hard-refresh in your browser will
> cause the page to be purged from the cache as well.
>
Thanks Sean. When you say "as of the current version", you mean 0.8.1 rather
than the RC, right? I am using 0.8.1 and doing a hard refresh definitely
doesn't clear the cache properly. In fact, the behaviour can get quite
strange: repeated hard-refreshes can deliver any one of several revisions of
the same page. I am guessing each refresh must pulling data from different
dbs that haven't been sync'd. But that's just a guess; I've really no idea
what's going on. :)
Doing Radiant::Cache.clear in the heroku console definitely seems to help
matters, though.
Sean
To round this discussion off, the Heroku docs say that the
Cache-Control header should be set to control the length of time a
page should stay in the cache:
http://docs.heroku.com/http-caching#caching-dynamic-content-by-age
Is it possible to control the max-age header in Radiant? If so, how?
Is it possible to set certain pages (and their children) to have a
discrete expiry? For instance, could I set the /news/ sub-tree with a
low 5 minute expiry and other sub-trees with a much higher expiry?
Cheers,
Charles
2009/12/1 Sean Cribbs <seanc...@gmail.com>:
---
I am not familiar with the particulars of Radiant caching. However,
Varnish can't be run clustered so our HTTP caching layer consists of n
individual Varnishes. You may see results propagating across the
Varnishes giving you an occasional stale hit. This is normal, and in
full usage on a busy site it's a very minor issue because it only takes
one request for the cached copy to update.
Also, the only way we have to purge the HTTP cache is heroku restart.
---
So, when I save a Radiant page/layout/snippet, the general process I
follow is this:
1. In the Heroku console, issue the Radiant::Cache.clear command and
hard-refresh in browser.
2. If changes still don't show, issue the heroku restart command and
hard-refresh again.
This seems to be a pretty robust way of clearing the Heroku and Radiant
caches. I've found that just doing step 1 seems to be enough, most of
the time.
As an aside, I've found Radiant running on Heroku to be a particularly
nice combination. Heroku's use of Varnish works exceedingly well with
Radiant, once you know how to bust the caches :). Once a page is cached
in Varnish, the backend doesn't get touched, so even with a free 1-dyno
account, you get really great performance.
This is possibly the most up-to-date tutorial, if anyone is interested:
http://j.mp/3ocDje [random facts girl: Radiant Heroku… getting your
Radiant App live on Heroku in about 10 minutes.]
Charles