Skip to content

Instantly share code, notes, and snippets.

@dsternlicht
Created September 17, 2017 07:45
Show Gist options
  • Select an option

  • Save dsternlicht/36bb43d3c8b4b8a8ad3239c4c3ab256d to your computer and use it in GitHub Desktop.

Select an option

Save dsternlicht/36bb43d3c8b4b8a8ad3239c4c3ab256d to your computer and use it in GitHub Desktop.
Initializing cache service in feeds model
// Initializing cache service in feeds model
import DB from '../db';
import CacheService from '../cache.service';
const ttl = 60 * 60 * 1; // cache for 1 Hour
const cache = new CacheService(ttl); // Create a new cache service instance
const FeedModel = {
...
};
export default FeedModel;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment