john muhl wrote:
On Tue, Jun 30, 2009 at 11:20 PM, Mohit Sindhwani<[email protected]> wrote:
Hi, just a quick question - how do I increase the page caching from 5
minutes to something much more?

My site has mostly static content other than the use of the comments
extension which itself clears the cache when the page changes.  I think it
would make a great difference to the performance to set the cache time out
to a much larger value.

My understanding is that I should add a line to
MYRADIANTAPP/config/environment.rb where it says:
  # Response Caching Defaults
  ResponseCache.defaults[:directory] =
ActionController::Base.page_cache_directory
  ResponseCache.defaults[:logger]    = ActionController::Base.logger

i can't recall exactly how it worked in 0.7 (search the radiant source
for "5.minutes" and you'll find the code that controls it) but in 0.8
there is a method on SiteController called cache_timeout that you use
to set the timeout to whatever you like. i stuck
`SiteController.cache_timeout = 60.minutes` in environment.rb fired up
a rails console, ran SiteController.cache_timeout.value and sure
enough i get 3600 back.

Thanks John and Jim,

I did what you suggested and came up with this in \vendor\radiant\app\models\response_cache.rb
 @@defaults = {
   :directory => ActionController::Base.page_cache_directory,
   :expire_time => 5.minutes,
   :default_extension => '.yml',
   :perform_caching => true,
   :logger => ActionController::Base.logger,
   :use_x_sendfile => false,
   :use_x_accel_redirect => false
 }

So, I guess, as Jim clarified, I would need to add:
ResponseCache.defaults[:expire_time] = 12.hours

That should do it!   Is anyone using really large numbers like 2400.hours?

Thanks,
Mohit.
7/2/2009 | 12:57 PM.



_______________________________________________
Radiant mailing list
Post:   [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to