On Jul 1, 2009, at 4:59 PM, john muhl wrote:
On Tue, Jun 30, 2009 at 11:20 PM, Mohit Sindhwani<t...@onghu.com>
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.
in something less than 0.8.0:
ResponseCache.defaults[:expire_time] = 12.hours
Otherwise, in 0.8.0 and greater, john is right:
SiteController.cache_timeout = 12.hours
Subscribe to the blog:
http://feeds.feedburner.com/FunWithRadiant
http://radiantcms.org/blog/archives/2009/06/08/developer-tips-responsecache-and-radiant-cache/
And why not plug my blog here too since I cover Radiant:
http://feeds2.feedburner.com/saturnflyer/blog
-Jim
Jim Gay
http://www.saturnflyer.com
_______________________________________________
Radiant mailing list
Post: Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant