OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
module API
module Caching
module Helpers
def with_etag!(key)
etag = %(W/"#{::Digest::SHA1.hexdigest(key.to_s)}")
error!("Not Modified".freeze, 304) if headers["If-None-Match".freeze] == etag
header "ETag".freeze, etag
end
##
# Store a represented object in its JSON representation
def cache(key, args = {})
# Save serialization since we're only dealing with strings here
args[:raw] = true
json = Rails.cache.fetch(key, args) do
result = yield
result.to_json
end
::API::Caching::StoredRepresenter.new json
end
end
end
end