I am looking for the best way to set the cache directory based on the
subdomain.
Example :
if the subdomain host is fr.mydomain.com, i want to cache the file in
ROOT/cache/fr and if it is en.mydomain.com, i want to cache the file in
ROOT/cache/en
The problem is that the cache directory is set in the config part of
rails and i dont know how to change it in realtime.
Any good advice ?
ps:
In my nginx config, of course, i would rewrite the uri based on this
subdomain. This part is already working.
class ApplicationController < ActionController::Base
...
class << self
def cache_page content, path
super content, @lang + path
end
end
end
where @lang is set in a before_filter of my controller. But it does not
work ! @lang is nil so i get an error like "The error occurred while
evaluating nil.+):"