darkmsph1t / _spartan

npm project to package & configure common security middleware && add security.js file to code repo
5 stars 0 forks source link

Populate Cache TTL #68

Closed darkmsph1t closed 6 years ago

darkmsph1t commented 6 years ago

I'm currently not doing anything with the Cache TTL that I request from the user. I either need to populate the cache max-age directive or I need to get rid of the question.

//current code block
{
    type : 'input',
    name : 'cacheTtl',
    message : "Q8.1. Cache Time To Live (TTL): For MOST public data generated by the application, how long (in seconds) should this information be cached?\n * Tip : Shorter TTLs will require more requests of the application origin; longer TTLs may result in stale, invalid data. You can override this on a per-route basis",
    default : 15780000, //<-- I don't do anything with this value...I need to populate max-age directive in cache-control
    when : function(answers){
      return answers.cacheStrategy
    },
    validate: function(value) {
      var valid = !isNaN(parseFloat(value));
      return valid || 'Please enter a number';
    },
    filter: Number
  },
darkmsph1t commented 6 years ago

done