tjanczuk / azurecache

Winows Azure Cache client and Express session store
Other
8 stars 1 forks source link

Inconsistencies with how ttl is used and documented #4

Open city41 opened 10 years ago

city41 commented 10 years ago

The README indicates to create a cache by

var cache = azurecache.create({
    identifier: '<your_endpoint_url>', // or set the AZURE_CACHE_IDENTIFIER environment variable
    token: '<your_access_key>', // or set the AZURE_CACHE_TOKEN environment variable
    ttl: 3600 // optional TTL in seconds (default 1 day); or set the AZURE_CACHE_TTL env variable
});

There are two issues with this

  1. the actual env variable used is AZURE_CACHE_TTL_SECONDS
  2. the ttl option passed into create() is ignored. The actual ttl that will be used is the one passed into put(), process.env.AZURE_CACHE_TTL_SECONDS or oneDay