Caching pages

Brutyn Nick wrote:

Hey,

I want to cache pages... I have this function show, and on top of my page I have the cache stuff. But it doesnt seem to work. Cuz I saw still queries in the development log file. Can anyone help me? I have tried caches_page and caches_action

And what about parameters like /show/1, /show/2, /show/3 =>> need to be different caches. Does anyone has any good full example?

class Frontend::ProductsController < FrontEndController

caches_page :show #caches_action :show

def show   @product = Product.find(:first, :conditions => ['id = ?', params[:id]])   if @product == nil     redirect_to :action => 'list'   end end

end

Thx N.

Caching is by default turned off in development environment, In your config/environments/production.rb file it sets some caching settings to true, meaning it works only in production mode

Hope this helps! Gustav gustav@rails.co.za