Action caching with dynamic cache names


I am attempting to cache a page that varies depending on the URL that
you go to. For example, goes to the
same action and controller as, but
the page is customized to the member.

I am currently accomplishing this with the following:


caches_action :new, :cache_path => :new_cache_path.to_proc
  def new_cache_path

This works fine, but I run into issues when I try and sweep the cache
because im am not sure how I can pass the member_name parameter to the
sweeper. The following is what I am using for a sweeper:


cache_sweeper :member_sweeper, :only => [ :update ]

class MemberSweeper < ActionController::Caching::Sweeper
  observe Member

  def after_save(product)

  def after_destroy(product)

  def expire_cache(product)
    expire_action 'member_name'

The members name is being passed to the member controller via the
submitted form, I just need to know if it is possible to pass it to
the sweeper.

Thanks for your help!