jmdobry / angular-cache

angular-cache is a very useful replacement for the Angular 1 $cacheFactory.
http://jmdobry.github.io/angular-cache
MIT License
1.39k stars 156 forks source link

works on localhost but not in production #271

Open thomasdolberg opened 5 years ago

thomasdolberg commented 5 years ago

I am having an issue with angular-cache not working in production but working fine on localhost.

I add some requests to a localstorage cache called "employeescache". The requests vary by parameter, eg: /api/employee?id=1 /api/employee?id=2 etc

On localhost these are being cached, and I can see that there is a key for each request.

On production there is only one key being saved at a time, and even though I refresh the page, it doesn't retrieve the data from cache using the key already in the cache.

On production I also get an error, which I don't get on localhost: Error: n is undefined get@https://cdnjs.cloudflare.com/ajax/libs/angular-cache/4.6.0/angular-cache.min.js:1:2250 r@https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular.min.js:89:20

Any ideas why this is?