Skip to content

ideasasylum/middleman-keycdn

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
This branch is 5 commits ahead, 6 commits behind andrusha:master.

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

About

An extension for middleman which allows you to invalidate KeyCDN cache

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%