No commit activity in last 3 years
No release in over 3 years
A Nesta plugin for disk cacheing via diskcached.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0

Runtime

>= 1.1.0
>= 0.9.11
 Project Readme

Nesta::Plugin::Diskcached

A Nesta Plugin for disk cache via diskcached. It is an alternative to using Nesta's built in Sinatra::Cache, which wasn't working quite right for me.

Installation

Add this line to your application's Gemfile:

gem 'nesta-plugin-diskcached'

And then execute:

$ bundle

Or install it yourself as:

$ gem install nesta-plugin-diskcached

Usage

Add optional params to your config/config.yml

diskcached: true # default
diskcached_timeout: 3600 # default (in seconds)
diskcached_dir: /tmp/diskcached 
  # defaults to "Nesta::Env.root/diskcached"
  # 
  # Values added for 'diskcached_dir' should
  # be a full path starting with '/', otherwise
  # Nesta::Env.root will be added to the beginning
  # of the path string.

Notes

  1. This has not been tested with nesta-plugin-simplicity and does not include overrides to include cacheing for anything Nesta's default renderers, namely:
    • haml
    • erb
  2. Currently this creates cache files for everything passed through rendering, which mean it creates a lot of extra and unused files. Ideally, it would only create a file for the final rendered result. It really doesn't hurt performance, but is just a bit ugly.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request