Forum: Ruby on Rails Cleaning Action Cache not working for show action

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Db90fac1650bf9dbd8e208c934ecdfa9?d=identicon&s=25 Jochen Kempf (jawosis)
on 2009-03-12 17:31
(Received via mailing list)
Hi,

I realized (in development environment with caching activated) that
cleaning the action cache for the show action is not working
properly.
The caching itself works fine - but once I try to clean the cache via
the corresponding sweeper, the show action fragment does not get
swept.

Here is the relevant sweeper method:
def clear_clientcontact_cache(clientcontact)
    expire_action(:controller => 'clientcontacts', :action =>
'show', :id => clientcontact.id)
  end

Here is the relevant logfile output:
[Cached fragment hit: views/localhost:3000/clientcontacts/show/1]
#this is the cached fragment
Expired fragment: views/localhost:3000/clientcontacts/1 (0.0ms)


The problem seems to be that the expired fragment does not coincidence
with the fragment the show action looks for: "views/localhost:3000/
clientcontacts/show/1" (--> "show" appears in the path) meanwhile the
expired fragment has no "show" in the path.


Anyone knows why that happens and how I can resolve it?

Thanks for your help!

jochen
This topic is locked and can not be replied to.