Skip to content

catallog/prerender-redis-cache

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

prerender-redis-cache

Forked from https://github.com/JonathanBennett/prerender-redis-cache. Like its base plugin it is designed to be used with the prerender node application from https://github.com/prerender/prerender.

How it works

This plugin stores pages returned through prerender in a redis instance.

How to use

In your local prerender project run:

    $ npm install git+https://github.com/collabo-br/prerender-redis-cache.git --save

Then in the server.js that initializes the prerender:

    var prerender_cache = require('prerender-redis-cache');
    var redis_settings = {
        "port": 6380,
        "database": 3,
        "page_ttl": 300
    };
    server.use(prerender_cache.init(redis_settings));
    server.use(require('prerender-redis-cache'));

A better approach however is to load the entire redis settings from a file eg.: cache_settings.json

Configuration

Supported configurations are:

  • port: 6379

  • hostname: 127.0.0.1

  • database: 0

  • page_ttl: 86400

    • Time, in seconds, whose redis will caches the pre-rendered page. Default values is one day(86400).

Acknowledgements

Thanks to the following for making branches with changes which were merged with the 0.2.0 release.

Fantastic Prerender team.

@nelsonkopliku

@eddietio

@irnc

Todo

  • password: ""

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%