No commit activity in last 3 years
No release in over 3 years
Modified Rack::StaticCache to work better with rack-zippy
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

zippy_static_cache

Modified Rack::StaticCache to work better with rack-zippy

Read here for the inspiration of this gem.

Installation

Place in your Gemfile

gem 'zippy_static_cache'

Run $ bundle install. Make sure you already have the rack_zippy gem included.

##Use

Example configuration for a middleman application. In config.ru

require 'rack'
require 'rack/contrib/try_static'
require 'rack-zippy'
require 'zippy_static_cache'

use ZippyStaticCache, :urls => ['/images', '/stylesheets', '/javascripts', '/fonts']
use Rack::Zippy::AssetServer, 'build'
use Rack::TryStatic,
  root: 'build',
  urls: %w[/],
  try: ['.html', 'index.html', '/index.html']
run lambda{ |env|
  four_oh_four_page = File.expand_path("../build/404/index.html", __FILE__)
  [ 404, { 'Content-Type'  => 'text/html'}, [ File.read(four_oh_four_page) ]]
}