Skip to content

twoheaded/prerender-mongodb-cache

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

prerender-mongodb-cache

Prerender plugin for MongoDB caching, to be used with the prerender node application from https://github.com/prerender/prerender.

How it works

This plugin will store all prerendered pages into a MongoDB instance.

How to use

In your local prerender project run:

$ npm i https://github.com/twoheaded/prerender-mongodb-cache.git --save

Then in the server.js that initializes the prerender:

server.use(require('prerender-mongodb-cache'));

Configuration

By default it will connect to your MongoDB instance running on localhost and use the prerender collection. You can overwrite this by setting the MONGOLAB_URI or MONGOHQ_URL environment variables to valid MongoDB connection strings.

This is done to make it work automatically when deployed on Heroku with the MongoDB add-ons.

You can set cache expiration time in CACHE_EXPIRATION_DAYS environment variable (in days). By default - 7 days.

About

Prerender plugin for MongoDB caching

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%