[Radiant] caching
Daniel Sheppard
daniels at thegroggysquirrel.com
Mon Jul 9 21:25:30 CDT 2007
> I have tried to track this bug with Aptana debugger on Windows.
> I'm using Radiant 0.6.2 (gem) with WEBrick server on my development
> machine.
>
> The problem is: ResponseCache instance is not living during
> whole server
> lifespan. It is recreated on every page request.
Yes, the ResponseCache instance is constantly recreated, but the ResponseCache class isn't being reloaded, and the defaults are
stored at the class level. (well, the class should not be reloaded, and as far as I can tell it isn't).
Editing the ResponseCache settings should be done like so:
ResponseCache.defaults[:perform_caching] = false
ResponseCache.defaults[:expire_time] = 10.minutes
in the development.rb file.
To test, I added a new tag in standard_tags.rb:
tag 'response_cache_settings' do |tag|
ResponseCache.defaults.inspect
end
included that tag on my homepage, started up the site and accessed the page a few times - it consistently gave back the expected
values.
Dan.
More information about the Radiant
mailing list