Skip to content

Instantly share code, notes, and snippets.

@azappa
Created April 30, 2015 10:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azappa/0f490a0d621a9e0b2011 to your computer and use it in GitHub Desktop.
Save azappa/0f490a0d621a9e0b2011 to your computer and use it in GitHub Desktop.
fix clear cache for prismic.io < 1.1.4

In app.js after routes:

app.route('/api/clear').get(routes.clearcache);

In routes/index.js

exports.clearcache = prismic.route(function(req, res, ctx) {
  ctx.api.apiCache.clear(function () {
    res.end(JSON.stringify({'cleared': 'ok'}, null, 2));
  });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment