Forum: Ruby on Rails Caching doesn't work at all...

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.
Johannes H. (Guest)
on 2006-05-17 23:11
Installed RoR under lighttpd and noticed that caching some actions
didn't accelerate page serving. The following little example of

class TestscriptController < ApplicationController
	caches_page :index

	def index
		@string = Time.now.to_s
	end
end

and

<html>
<head>
<title>Test</title>
</head>
<body>
<p>Test</p>
<p><%= controller.action_name %></p>
<p><%= @string %></p>
</body>
</html>

does work in development mode with caching turned on under WinXP with
Webrick. It does not work in lighttpd with fastcgi on FedoraCore. I
already browsed through the various log but no obvious errors were to be
seen.

And Rails / Ruby is able to write into the public directory (as another
script of mine puts to good effect).

So, does anyone know where the problem might lie?
Jón B. (Guest)
on 2006-05-17 23:19
(Received via mailing list)
Are you manually setting caching to on under development mode?

On 5/17/06, Johannes H. <removed_email_address@domain.invalid> wrote:
>
> </body>
> So, does anyone know where the problem might lie?
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
>


--
Johannes H. (Guest)
on 2006-05-17 23:33
Well, Webrick runs in development mode with caching manually turned on
and works fine.

Lighttpd runs in production mode with the default parameters from
/environment/production.rb and does not work.

I just tried some shenannigans with the config files and suddenly the
above example will create the testscript.html in /public. However, for
some weird reason, the testscript.html is always updated which somewhat
defeats the purpose of caching.

And production.log only tells me:

Processing TestscriptController#index (for 124.576.63.1 at 2006-05-17
21:31:01) [GET]
  Session ID:
  Parameters: {"action"=>"index", "controller"=>"testscript"}
Rendering testscript/index
Completed in 0.00559 (178 reqs/sec) | Rendering: 0.00107 (19%) | DB:
0.00000 (0%) | 200 OK
This topic is locked and can not be replied to.