mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-10-09 08:10:08 +09:00
21 lines
506 B
Ruby
21 lines
506 B
Ruby
# Native view caches share one byte budget across every database generation.
|
|
class FragmentCache
|
|
# Only callers that fingerprint every rendered dependency may omit the epoch.
|
|
ContentKey = Data.define(:digest) do
|
|
def cache_key
|
|
digest
|
|
end
|
|
end
|
|
|
|
STORE = ActiveSupport::Cache::MemoryStore.new(size: 64.megabytes)
|
|
private_constant :STORE
|
|
|
|
def self.store
|
|
STORE
|
|
end
|
|
|
|
def self.transaction_open?
|
|
ActiveRecord::Base.connection_pool.with_connection(&:transaction_open?)
|
|
end
|
|
end
|