Project

precacher

0.0
No commit activity in last 3 years
No release in over 3 years
Precacher make sit simple to keep static files up to data with dynamic data that could change minute to minute.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 3.0
 Project Readme

Precacher

About

Precacher is written to update static files based on Ruby code. In the future it could be expanded to work in memcache, and other caching solutions.

Install Precacher:

in your Gemfile:

gem "precacher"

and bundle install!

How to use Precacher:

    val = Precacher.file_cache("/path/to/file") do
      # if data generated is the same, file is not updated.
      MyCreateFileData('file')
    end
    # val is true if their was a write, and false if not.

Why it was created:

I had a simple HTML/JS project that needs to possibly update a JSON file anytime in 1-90 days windows.

I did not want an entire RAILS stack for just this part, but I did want to use other ruby gems.

So I just updated the static files via a cron job every hour, only if they were updated.

To do

  • More documentation