Rails Caching Problems

software development

#1

Just curious if anybody else is having cache problems with Ruby on Rails, I’m running Typo so maybe it’s an issue with this CMS and not Rails, per se.

I figured in development mode, my pages wouldn’t be cached and in production mode everything would be cached. Turns out that no matter what mode I am running in, everything is cached (CSS, Images, etc…).

It’s a total pain in the arse to have to manually clear the cache everytime I upload a new version of a file, anybody found a fix for this?


#2

Nobody? What the heck?


#3

First, check config/environments/development.rb:

ActionController::Base.perform_caching should be false. If it’s not, make sure it is.


#4

DH has set the environment variable RAILS_ENV to production so if you have the line

RAILS_ENV = ENV[‘RAILS_ENV’] || ‘development’

at the top of your environment.rb, then your app will always be in production mode. I bet this is the problem. To get around it, just get rid of the ENV[‘RAILS_ENV’] || part, so the line reads

RAILS_ENV = ‘development’

Good luck,

Sean


#5

Awesome Apterigo, that’s what I needed. I didn’t realize there were those config values in there. Although I can’t get my Rails app to run in development mode, I just altered the production.rb file to not cache (I’ll turn it back on when I’m done developing).

Thanks again :slight_smile: