Extension Cacheapi


Extension Basics

Title
Cacheapi
Name
ckanext-cacheapi
Type
Public extension
Description
CKAN extension: API for clearing NGINX caches
CKAN versions
Download-Url (zip)
Last commit
11 years ago (2014-08-18 09:10:46)
Url to repo
Category
Specialized Tools


Background Infos

Description (long)
Show details

ckanext-cacheapi

CKAN extension: Clear NGINX caches.

setup

NGINX

Add proxy cache bypass cookie to your Nginx config file

proxy_cache_bypass $http_x_example;

http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_bypass

SETTINGS

Set http_x_cookie_name to the cookie name used above.

ckanext.cacheapi.http_x_cookie_name = example

CKAN

You can either clear a URL, or group of URLS.

To create a group of URLs, implement the ICache interface in your plugin

p.implements(ICache, inherit=True)

Which returns a dictionary of group names and list of URLS

ICache

def get_caches(self, context, cache_dict):

cache_dict['example_group'] = [
    'url1',
    'url2',
    ...
]

return cache_dict

Commands

You can then clear the cache with:

paster cache clear example_group -c path/to/config

Or for just a URL:

paster cache clear url -c path/to/config

Version
Version release date
(not set)
Contact name
Ben Scott
Contakt email
(not set)
Contact Url
(not set)


Installation Guide

Configuration hints
Plugins to configure (ckan.ini)
cacheapi
CKAN Settings (ckan.ini)
# ckanext.cacheapi.http_x_cookie_name = example
DB migration to be executed
(not set)
<< back to Extensions