avoiding output caching, mod_ruby/Apache?

R

Roman Snitko

I got that annoying thing: all pages that are parsed by Ruby - they
cache somehow, so that I have to restart Apache in order to see any
changes in browser. It's not FastCGI, because I turned it of, so that
could be mod_ruby, I guess. But I have no idea of how to configure it
not to cache the output. Does anyone have a clue?
 
J

Justin Collins

Roman said:
I got that annoying thing: all pages that are parsed by Ruby - they
cache somehow, so that I have to restart Apache in order to see any
changes in browser. It's not FastCGI, because I turned it of, so that
could be mod_ruby, I guess. But I have no idea of how to configure it
not to cache the output. Does anyone have a clue?

What do you mean by "pages that are parsed by Ruby"? Do you mean code in
rb files or libraries, or do you mean .rhtml files which use erb, or...?
If it's code or libraries, remember that mod_ruby is just using one
instance of a Ruby interpreter. So, once a file is loaded, that's the
version it uses, just like if you were using it in IRB or a running
program. It isn't going to reload your code every time you make a
change. Restarting Apache will force it to start off with a fresh
interpreter.

Hope that helps clear it up a little bit.

-Justin
 
R

Roman Snitko

Yeah, thanks, I think I'm getting it.

The story is, I have an .rhtml file, that requires another .rb file.
I read, of course, that ruby 'requires' file only once, but i thought
this statement takes action only during current let's call it "page
loading", not during the whole session.

Will replacing 'require' with 'load' fix this?
 
J

Justin Collins

Roman said:
Yeah, thanks, I think I'm getting it.

The story is, I have an .rhtml file, that requires another .rb file.
I read, of course, that ruby 'requires' file only once, but i thought
this statement takes action only during current let's call it "page
loading", not during the whole session.

Will replacing 'require' with 'load' fix this?

I'm pretty sure it will. Note that you will probably have to add ".rb"
to the end of the file, e.g., load "myfile.rb" instead of require "myfile"

-Justin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top