Project

saxondale

0.0
No commit activity in last 3 years
No release in over 3 years
ETags for ActiveFedora datastreams.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 3.2.3
 Project Readme

Saxondale

ETags for assets that are delivered with Rails controllers

#####Purpose

The assets in FedoraCommons are expensive to load. This gem uses Rails conventions to cache and compare the hashes of ETags.

#####Add to your Gemfile

  gem 'saxondale'

#####Examples

# app/controllers/image_controller.rb
etag :thumbnail

def thumbnail
  @image = Image.find(params[:id])
  authorize! :read, @image
  data_stream = @image.datastreams['thumbnail']
  send_data data_stream.content, 
    filename: 'thumbnail', 
    disposition: :inline, 
    type: ds.mimeType)
end
 # app/models/image.rb
  expire_etag :thumbnail