Production and cache

Hello!
i have made a multisite system.

Depending on the url of the request (www.clerk.it / www.fastshare.it /
…) it generate a different website, this is the fron-end, each sites
have a different back-end too where the user can manage a lot of
different thing based upon the installation configuration (it’s
basically a CRM + ERP) so it’s content can change every second.

Now my problem is the following, if i enable caching in production
enviroments the system will not send the correct resource (some image as
attachment), this is caused by the fact that the url except for the
domain name are the same so the caching system find a page named “index”
and send it, even if it’s not the correct one.

My question is: can i set a different cache directory based on domain
name? if yes… how? (i have to add a new site without restarting the
service of course…)

Somehow I thought that was how it worked by default. For example, my
site
caches files as:

~/thepeoplesfeed/tmp/cache/views/www.thepeoplesfeed.com/…

What cache are you using? I’m not sure the memory cache splits things
by
domain.

On Tue, Jul 21, 2009 at 11:52 AM, Alessandro S. <
[email protected]> wrote:

Now my problem is the following, if i enable caching in production
http://www.ruby-forum.com/attachment/3889/screenshot.zip


Posted via http://www.ruby-forum.com/.

Jim
http://www.thepeoplesfeed.com/contribute

I have read a lot this few days about caching in ruby…

I see that the only solution for me is to use cache action and part of
the view… a really hard work (ps under tmp/cache i have no files)

James E. wrote:

Somehow I thought that was how it worked by default. For example, my
site
caches files as:

~/thepeoplesfeed/tmp/cache/views/www.thepeoplesfeed.com/…

What cache are you using? I’m not sure the memory cache splits things
by
domain.

On Tue, Jul 21, 2009 at 11:52 AM, Alessandro S. <
[email protected]> wrote:

Now my problem is the following, if i enable caching in production
http://www.ruby-forum.com/attachment/3889/screenshot.zip


Posted via http://www.ruby-forum.com/.

Jim
http://www.thepeoplesfeed.com/contribute

James E. wrote:

What kind of cache are you using? Could you copy your environment file
here?

On Wed, Jul 22, 2009 at 4:32 AM, Alessandro S. <

It’s the dafault file, i have made no change

Settings specified here will take precedence over those in

config/environment.rb

The production environment is meant for finished, “live” apps.

Code is not reloaded between requests

config.cache_classes = true

Full error reports are disabled and caching is turned on

config.action_controller.consider_all_requests_local = false
config.action_controller.perform_caching = false
config.action_view.cache_template_loading = false

See everything in the log (default is :info)

config.log_level = :debug

Use a different logger for distributed setups

config.logger = SyslogLogger.new

Use a different cache store in production

config.cache_store = :mem_cache_store

Enable serving of images, stylesheets, and javascripts from an asset

server

config.action_controller.asset_host = “http://assets.example.com

What kind of cache are you using? Could you copy your environment file
here?

On Wed, Jul 22, 2009 at 4:32 AM, Alessandro S. <

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs