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...) Attachments: http://www.ruby-forum.com/attachment/3889/screenshot.zip -- Posted via http://www.ruby-forum.com/.
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 Scolavino < rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > 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...) > > Attachments: > http://www.ruby-forum.com/attachment/3889/screenshot.zip > > -- > Posted via http://www.ruby-forum.com/. > > > >-- ====================Jim http://www.thepeoplesfeed.com/contribute --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 Englert 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 Scolavino < > rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> 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-- Posted via http://www.ruby-forum.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 Scolavino < rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > 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 Englert 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 Scolavino < > > rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> 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 > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
James Englert 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 Scolavino <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" -- Posted via http://www.ruby-forum.com/.