Sha256: a2d3d891d6e3fd3a0fb14482bc150875f3df8f13a47a06f4735a33f3f8afc726

Contents?: true

Size: 630 Bytes

Versions: 3

Compression:

Stored size: 630 Bytes

Contents

# encoding: utf-8

module PagesCore
  module DomainBasedCache
    extend ActiveSupport::Concern

    included do
      before_action :set_domain_based_cache_path
    end

    module ClassMethods
      def default_page_cache_directory
        @default_page_cache_directory ||=
          ActionController::Base.page_cache_directory
      end
    end

    protected

    def set_domain_based_cache_path
      return unless PagesCore.config(:domain_based_cache)
      ActionController::Base.page_cache_directory = File.join(
        ApplicationController.default_page_cache_directory,
        request.domain
      )
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pages_core-3.4.3 app/controllers/concerns/pages_core/domain_based_cache.rb
pages_core-3.5.1 app/controllers/concerns/pages_core/domain_based_cache.rb
pages_core-3.4.2 app/controllers/concerns/pages_core/domain_based_cache.rb