Cache not being used?

Added by Coeus Coeus about 12 years ago

First of all, great app. So far I'm loving it.

The one issue I'm having has to do with speed. I notice the app is running rather slow. I've got it working on my server which uses Apache 1.3.

I look in the tmp/cache folder but I don't see any files being stored there so I assume cache is disabled.

How do I get the cache system working with Redmine? And is there anything else I can do to speed it up?

Replies (8)

RE: Cache not being used? - Added by Mischa The Evil about 12 years ago

Coeus Coeus wrote:

I look in the tmp/cache folder but I don't see any files being stored there so I assume cache is disabled.

How do I get the cache system working with Redmine?

I've been wondering about this earlier also, but haven't been able to test it yet. Though I guess you should start with the following snippet in source:trunk/config/environment.rb#L38:

  # Enable page/fragment caching by setting a file-based store
  # (remember to create the caching directory and make it readable to the application)
  # config.action_controller.fragment_cache_store = :file_store, "#{RAILS_ROOT}/cache" 

Make sure you modify the cache-location and make sure the correct permissions apply to the path for the webserver to be able to write to the cache-location.

HTH...

RE: Cache not being used? - Added by Coeus Coeus about 12 years ago

Make sure you modify the cache-location and make sure the correct permissions apply to the path for the webserver to be able to write to the cache-location.

I actually enabled that last line and made the cache folder fully writable, but still no dice.

RE: Cache not being used? - Added by Mischa The Evil about 12 years ago

Coeus Coeus wrote:

...I actually enabled that last line...

Try changing that line to:

  # config.action_controller.fragment_cache_store = :file_store, "#{RAILS_ROOT}/tmp/cache" 

and restart the app.

That could do the trick... Hope it helps...

RE: Cache not being used? - Added by Coeus Coeus about 12 years ago

Hmm, still doesn't seem to work. The /tmp/cache/ is still empty.

RE: Cache not being used? - Added by Mischa The Evil about 12 years ago

Coeus Coeus wrote:

Hmm, still doesn't seem to work. The /tmp/cache/ is still empty.

To be sure: are you sure you've restarted Redmine (as in restarting Mongrel, Apache or other Server)?

Otherwise I don't know any solution atm, sorry... Though I'll look at it in the future... Maybe others?

RE: Cache not being used? - Added by Coeus Coeus about 12 years ago

I didn't restart Apache, but I don't think that needed to be done. The reason I say this is because I later modified the same file to update the SMTP configuration and without restarting the server the new smtp settings were being used.

RE: Cache not being used? - Added by Mischa The Evil about 12 years ago

Afer some investigation I found out that RoR has several caching-mechanisms:
  • Page Caching (normally in "{RAILS_ROOT}/public/cache", configurable using config.action_controller.page_cache_directory)
  • Action Caching
  • Fragment Caching (normally in "{RAILS_ROOT}/tmp/cache", configurable using config.action_controller.fragment_cache_store)

From what I've seen it only supports some limited Fragment Caching for some parts of the revisions-view (ie. diff). This could be configured using the following settings in ../config/environment.rb:

config.action_controller.perform_caching = true
config.action_controller.fragment_cache_store = :file_store, "#{RAILS_ROOT}/tmp/cache" 

I won't do any more research on this issue due to the fact that I don't need it thát much...

Though, "to whome it may concern", here are some links to very detailed and extensive resources:

RE: Cache not being used? - Added by nick cuneo about 9 years ago

Sorry to bring up an old thread, but I've also tried turning on caching on our redmine installation and it doesn't appear to be working, following the steps given above. Any solutions?

(1-8/8)