prerender-cache-mongodb
v0.0.6
Published
Prerender plugin using mongodb for caching with ability to invalidate by queryparams
Downloads
3
Readme
prerender-mongo-cache
Prerender cache plugin using mongodb with ability to invalidate by queryparams Plugin works with https://github.com/prerender/prerender.
Description
Plugin store all prerendered pages in MongoDB instanse. New collection created for each domain. Each page saved with url path for further ability to invalidate it.
Instalation
$ npm install prerender-cache-mongodb --save
Then add it to plugins in server.js
:
server.use(require('prerender-cache-mongodb'));
Usage
By default plugin will use path: mongodb://localhost:27017/prerender
.
You can override it with MONGO_PRERENDER_URL
environment variable.
You can invalidate saved pages by query params:
?invalidate=page - will invalidate one document with given url address
?invalidate=all - will invalidate all documents in collection with page hostname
For example:
https://github.com/baterson/master?readme=1&invalidate=page
Wil invalidate page https://github.com/baterson/master?readme=1
in collection github.com
https://github.com/baterson/master?readme=1&invalidate=all
Will remove all documents from collection github.com