Forum: Ruby on Rails Caching question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
ben wiseley (Guest)
on 2005-12-18 18:40
(Received via mailing list)
I've got caching mostly working but it's acting string with the
index/home.


On the site I have a redirect the points http://nutritionreality.com at
http://nutritionreality.com/home

I do this in routes.rb by:
map.index '', :controller  => 'home', :action => 'index'

Caching happens on index (index.html gets created in public) but rails
won't
create/cache home.html - which slows the site down.  If I copy
public\index.html -> public\home.html I get the performance increase but
rails will never create home.html on it's own.  What am I missing?

Here is my home_controller.rb file.  Initially it just had "def index"
but I
added "def home" while trying various solution.

class HomeController < ApplicationController

  caches_page :index
  caches_page :home

  layout "ui"

  def index
    @siteoption = Siteoption.GetSiteOptionHash("Home")
    @header_image = @siteoption["header_image"]
    @header_text = @siteoption["header_text"]
    @blogentry_pages, @blogentries = paginate :blogentry, :per_page =>
10,
:order_by => 'created_on asc', :conditions => "blog_id = 10"
    render(:template => "/home/index")
  end

  def home
    render(:action => :index)
  end

 end
This topic is locked and can not be replied to.