rails/actionpack-page_caching

question: page caching with multiple domains

fabioperrella opened this issue · 1 comments

Hi, is it possible to use page caching with multiple domains?
I would like to write html files in filesystem like page cache does, but putting them into a folder named with the domain
Then, I would use nginx and rewrite to show these pages

This is really a support question - please use the appropriate resources for these kind of questions (Stack Overflow, mailing lists, irc, etc.) as this website is for tracking bugs.

However off the top of my head I'd probably set the page_cache_directory in a before filter, e.g.

class PagesController < ApplicationController
  before_filter: set_page_cache_directory

  protected

  def set_page_cache_directory
    self.page_cache_directory = File.join(Rails.public_path, 'cache', request.host)
  end
end

I've not confirmed this so you're on your own if it doesn't work.