An extension for middleman which allows you to invalidate KeyCDN cache
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 5 commits ahead, 3 commits behind andrusha:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
spec
.gitignore
.travis.yml
Gemfile
Guardfile
LICENSE
README.md
Rakefile
middleman-keycdn.gemspec

README.md

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