#69 ✓resolved
Lee Fyock

local_cache_for_request doesn't expire correctly

Reported by Lee Fyock | July 26th, 2007 @ 02:15 PM

See <http: /> for more info.

The "cached?" method (down the chain from expire_cache_without_local_cache) calls back to "fetch_cache_with_local_cache", populating the local_cache method with data from memcache, after the local cache has been deleted in expire_cache_with_local_cache, hence popping the old value back into local_cache.

This problem is testable by putting something like the following into a controller method, making sure that :local_cache_for_request is a before_filter in application.rb, and that the Something model has an after_save => expire_cache filter.

@something = Something.get_cache(@something.id)

num = rand(1000).to_s

@something.a_field = num

@something.save!

@something = Something.get_cache(@something.id)

logger.error "============************>>>>>>>>>> Something is

#...@something.a_field}, should be #{num}"

We've fixed this in our copy of cache_fu by switching the two lines in expire_cache_with_local_cache so that the

local cache gets blown away after it's repopulated by the

expire_cache_without_local_cache.

Thanks,

Lee

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Shared Ticket Bins

People watching this ticket

Pages