Is there a simple way to regenerate a Rails page cache? Destroying the cache is easy:
Person.each.all do |person|
expire_page(:controller => 'yql', :action => 'feed', :id => person.id)
end
This deletes the cached files in the public directory. Right after I destroy them though, I want to recreate them. I don’t want to wait until they are viewed on the public web site.
Is there a simple rails way to do this.
Many thanks
A better solution is to expire the page, then hit it using curl. Because curl generates a new request, the Passenger only needs enough memory to render one feed. It also avoids going round the caching system.
Of course, this is a linux only solution. It’s also improtant to watch out for race conditions.