Developer Tips: ResponseCache and Radiant::Cache

Posted by Jim Gay on Monday, June 08, 2009 | |

If you’re looking to test out your site on edge to prepare for the next release but aren’t ready to take the plunge, you can alter your environments to selectively set up ResponseCache

if defined? ResponseCache == ‘constant’ ResponseCache.defaults[:perform_caching] = true end

You may also set the cache_timeout for SiteController which will stand in the place of ResponseCache.defaults[:expire_time]

config.after_initialize do … if defined? ResponseCache == ‘constant’ ResponseCache.defaults[:expire_time] = 12.hours else SiteController.cache_timeout = 12.hours end … end

That should get you going as you kick the tires on 0.8.

If you’re looking for more control, take a look at the source and know that Radiant::Cache is now implemented in Rack::Cache and of course, keep your eye on the wiki page for developer upgrades