No commit activity in last 3 years
No release in over 3 years
Adds ability to invalidate a specific set of files in your KeyCDN cache
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

>= 0.9.0
~> 3.0

Runtime

~> 1.5
~> 0.1.1
 Project Readme

Middleman KeyCDN Build Status Dependency Status Code Climate

A deploying tool for middleman which invalidates a KeyCDN cache.

Based almost entirely on middleman-cloudfront and used together with middleman-s3_sync (though you can use whatever deployment method & KeyCDN source you want)

Some of its features are:

  • KeyCDN cache invalidation — either purge the whole cache or just updated selected URLs;
  • Ability to call it from command line and after middleman build;
  • Ability to filter files which are going to be invalidated by regex;

Usage

Installation

Add this to Gemfile:

gem 'middleman-keycdn'

Then run:

bundle install

Configuration

Edit config.rb and add:

activate :keycdn do |cdn|
  cdn.api_key = ENV['KEYCDN_API_KEY']
  cdn.zone_id = ENV['KEYCDN_ZONE_ID']
  cdn.base_url = ENV['KEYCDN_BASE_URL']
  cdn.purge_all = true
  cdn.filter = /.html$/i  # default is /.*/
  cdn.after_build = true  # default is false
end```

## Running

If you set `after_build` to `true` cache would be automatically invalidated after build:  
```bash
bundle exec middleman build

Otherwise you should run it through commandline interface like so:

bundle exec middleman invalidate